how to create two counter loops that run at the same time in matlab??

Status
Not open for further replies.

prashanthi999

Member level 1
Joined
Nov 19, 2014
Messages
39
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
287
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.
 

the answer is this

Code:
for m = 1:16
     n = 1+mod(m-1,4);
end
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…