how to save values from'if' loop?
Ältere Kommentare anzeigen
for j = 1:sz_idx1(1,1)
new_idx = idx1(j);
alt_i = alt{new_idx};
if ( alt_i== 'T')
A_T = count+1;
end
end
Akzeptierte Antwort
Weitere Antworten (1)
What about:
A_T = cumsum(strcmp(alt{idx1}, 'T'))
instead of the loops? Or perhaps you want:
A_T = sum(strcmp(alt{idx1}, 'T'))
or
A_T = 1:sum(strcmp(alt{idx1}, 'T'))
Kategorien
Mehr zu Introduction to Installation and Licensing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!