How do I replace elements of an array with letters?
5 views (last 30 days)
Hi, I have an array called 'labels_I03' which is filled with zeros, and I am trying to replace the elements of this array with either 'N' or 'A' based on whether the index of the array element is part of a separate vector called 'abnormal_cycles_I03'. I am currently using a 'for' loop as shown below, but this does not seem to be working. It just returns an array full of zeros. Any suggestions would be greatly appreciated, thanks in advance.
labels_I03 = categorical(zeros(1, number_cycles));
abnormal_cycles_I03 = ;
for i = number_cycles - 1
if ~ismember(i, abnormal_cycles_I03)
labels_I03(i) = 'N';
labels_I03(i) = 'A';