Info
此问题已关闭。 请重新打开它进行编辑或回答。
How do i do a for loop within a for loop with a variable changing n=1:42.
2 次查看(过去 30 天)
显示 更早的评论
If i wanted to create a for loop where n=1:42, but there is another variable, l whose dimension is dependant on the variable n. how would i notate the change for l. for instance, if for n=2:6,9 l=1:16 but for n=42, l=1:53, how could i construct the for loops to give me outputs without the error "indices exceed matrix dimensions" Thanks
0 个评论
回答(1 个)
James Tursa
2015-9-23
Why can't you use simple if-tests on the value of n to set the value of I?
1 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!