how to create two counter loops that run at the same time in matlab??
2 次查看(过去 30 天)
显示 更早的评论
hello every one, how to create two counter loops that start at the same time in matlab editor and gets applied on given code at the same time using for loop??
for example: counter "1" should run like 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16. counter "2" should run like 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4. for the same code, kindly help me.
0 个评论
采纳的回答
Stephen23
2016-2-4
This loop:
for m = 1:16
n = 1+mod(m-1,4);
disp([m,n])
end
displays the variables m and n in the command window:
1 1
2 2
3 3
4 4
5 1
6 2
7 3
8 4
9 1
10 2
11 3
12 4
13 1
14 2
15 3
16 4
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!