Storing results from for-loop
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
LukeJes
am 3 Sep. 2020
Beantwortet: Serhii Tetora
am 3 Sep. 2020
Just wondering how I should go about storing all of the values that I get out of this loop in 'idx' without overriding the previous itteration.
idx = []
for i = length (grfcutl)
a = grfcutl{i}
b = find(a<=0)
idx = b(1)
end
Thanks!
0 Kommentare
Akzeptierte Antwort
Serhii Tetora
am 3 Sep. 2020
idx = [];
for i = 1:length(grfcutl)
a = grfcutl{i};
idx(end+1) = find(a<=0,1,'first')
end
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!