Effacer les filtres
Effacer les filtres

Storing results from for-loop

1 vue (au cours des 30 derniers jours)
LukeJes
LukeJes le 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!

Réponse acceptée

Serhii Tetora
Serhii Tetora le 3 Sep 2020
idx = [];
for i = 1:length(grfcutl)
a = grfcutl{i};
idx(end+1) = find(a<=0,1,'first')
end

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by