Answer:
dont procrastinate and try to keep all your files organized
Explanation:
B. Table
C. Event handler
D. Object
b. filtering messages through past experiences
c. minimizing external and psychological noise
d. making sense out of words and messages
Answer:
function [ repPos, pinCodeFix ] = pinCodeCheck( pinCode )
pinCodeFixTemp = pinCode;
repPosTemp = [];
for i = 1:length(pinCode)
if((i > 1)) & (pinCode(i) == pinCode(i - 1))
repPosTemp([i]) = i;
else
repPosTemp([i]) = 0;
end
end
for i = 1:length(pinCode)
if(repPosTemp(i) > 0)
pinCodeFixTemp(i) = 0;
end
end
repPosTemp = nonzeros(repPosTemp);
pinCodeFixTemp = nonzeros(pinCodeFixTemp);
repPos = repPosTemp';
pinCodeFix = pinCodeFixTemp';
end
Explanation:
Let me start off by saying this isn't the most efficient way to do this, but it will work.
Temporary variables are created to hold the values of the return arrays.
pinCodeFixTemp = pinCode;
repPosTemp = [];
A for loop iterates through the length of the pinCode array
for i = 1:length(pinCode)
The if statement checks first to see if the index is greater than 1 to prevent the array from going out of scope and causing an error, then it also checks if the value in the pinCode array is equal to the value before it, if so, the index is stored in the temporary repPos.
if((i > 1)) & (pinCode(i) == pinCode(i - 1))
repPosTemp([i]) = i;
Otherwise, the index will be zero.
else
repPosTemp([i]) = 0;
Then another for loop is created to check the values of the temporary repPos to see if there are any repeating values, if so, those indexes will be set to zero.
for i = 1:length(pinCode)
if(repPosTemp(i) > 0)
pinCodeFixTemp(i) = 0;
Last, the zeros are removed from both temporary arrays by using the nonzeros function. This causes the row array to become a column array and the final answer is the temporary values transposed.
repPosTemp = nonzeros(repPosTemp);
pinCodeFixTemp = nonzeros(pinCodeFixTemp);
repPos = repPosTemp';
pinCodeFix = pinCodeFixTemp';