Could anyone help me if there is any way to avoid for loop in the following code: Both Target and predicted_target are vectors with n rows and one column.
new_classes=cell(size(Target,1),1);for i=1:size(Target,1) if (strcmp(predicted_target(i),Target{i})) new_classes{i}=strcat('c',Target{i}); else new_classes{i}=strcat('E',Target{i}); endend
Best Answer