repeat many conditions of for loop

조회 수: 2 (최근 30일)
Nay Rein
Nay Rein 2015년 10월 24일
답변: Walter Roberson 2015년 10월 25일
I'm very new Mathlab user. May i know how can I generate for loop with many conditions by using repeat. I have two statement for "for"loop. and the conditions are like (i=1:64, i=1:128, i=256,....). I have to get the result from every condition.(ans1 from i=1:64, ans2 from i=128,...)

채택된 답변

Walter Roberson
Walter Roberson 2015년 10월 25일
upper_limits = [64, 128, 256];
for ul_idx = 1 : length(upper_limits)
upper_limit = upper_limits(ul_idx);
for i = 1 : upper_limit
..
end
result(ul_idx) = some calculated result
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by