Dynamic Loop with for

1 回表示 (過去 30 日間)
Dzevat
Dzevat 2018 年 8 月 9 日
再開済み: Walter Roberson 2018 年 12 月 22 日
Dynamic Loop
  1 件のコメント
Stephen23
Stephen23 2018 年 8 月 9 日
What is a "dynamic loop"? Please show us your code so we have some idea of what you are doing.

サインインしてコメントする。

採用された回答

KSSV
KSSV 2018 年 8 月 9 日
編集済み: KSSV 2018 年 8 月 9 日
N = [6 44 ; 170 179 ; 198 203] ;
iwant = cell(size(N,1),1) ;
for i = 1:size(N,1)
for j = N(i,1):N(i,2)
iwant{i} = [iwant{i} j] ; % just demo to show the variables after loop
end
end
iwant{1}
iwant{2}
iwant{3}
  1 件のコメント
KSSV
KSSV 2018 年 8 月 9 日
The code should work for any N...edited the code with present N..check.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by