alwaysneedhelp84
alwaysneedhelp84
30.11.2019 • 
Engineering

Apincode consists of n integers between 1 and 9. in a valid pincode code no integer is allow to repeat consecutively. for example, the sequence 1,2,1,3 is valid because even though 1 occurs twice, it is not consecutive. however, sequence 1,2,2,1 is invalid because 2 occurs twice, consecutively utilize a for loop and branch statements to write a function pincodecheck to detect and eliminate all the consecutive repetitions in the row array pincode. the outputs are two row arrays. the row array reppos contains the positions pincode where there are consecutive repeats occurs, and the row array pincodefix is a valid pincode with all the consecutive repeats removed in pincode for example: if pincode=[2 9 9 5 8 24989] then [ reppos, pincodefix ] = pincodecheck( pincode ) produces reppos = pincodefix = 2 9 2 4 9 9 your function save c reset matlab documentation 1 function [ reppos, pincodefix ] = pincodecheck( pincode ) % your solution goes here 5 en code to call your function c reset 1 [ reppos, pincodefix ] = pincodecheck( pincode )

Solved
Show answers

Ask an AI advisor a question