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 CenterFile Exchange 中查找有关 Creating, 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