I have a big code but i want to make a for loop to execute the code.My code is below:
A = zeros(1, 60) ; C = A ; D = A ; F = A ; ....... if( sum(B) == 100 ) A= A(1) + 1; elseif( sum(B) == (99) ) C(1) = C(1) + 1; elseif( sum(B) == (98) ) D(1) = D(1) + 1; elseif( sum(B) == (97) ) E(1) = E(1) + 1; ......... end O1=A; O2=C; O3=D; O4=F; O=[O1,O2,O3,O4] I need to check upto sum(B)==1 so its looks worse if i write the whole condition using elseif so i want to use a for loop to execute this condition.But i cant do this.
Matlab experts needs your valuable sugggestion and help.