Is there any way to get as same a result as the code below without having that annoying for loop?
A = [1; 1; 0; 0; 0; 0; 1];for i = 1 : 7 if A(i) == 0 B(i).C = 'w'; elseif A(i) == 1 B(i).C = 'b'; end;end
arraystruct
A = [1; 1; 0; 0; 0; 0; 1];for i = 1 : 7 if A(i) == 0 B(i).C = 'w'; elseif A(i) == 1 B(i).C = 'b'; end;end
Best Answer