Storing results from for-loop

1 回表示 (過去 30 日間)
LukeJes
LukeJes 2020 年 9 月 3 日
回答済み: Serhii Tetora 2020 年 9 月 3 日
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!

採用された回答

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by