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일

0 개 추천

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

2020년 9월 3일

답변:

2020년 9월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by