필터 지우기
필터 지우기

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 CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by