Trying to repeat this for loop
Info
This question is closed. Reopen it to edit or answer.
Show older comments
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwweeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
1 Comment
Azzi Abdelmalek
on 7 May 2013
Why did you delete the question?
Answers (1)
Azzi Abdelmalek
on 3 May 2013
Edited: Azzi Abdelmalek
on 3 May 2013
put the loop inside another loop. Can give more details how do you want to repeat this loop?
Edit
d=diff(p(1:100))
result=d==0
out=sum(result)
5 Comments
tunny
on 3 May 2013
Azzi Abdelmalek
on 3 May 2013
Edited: Azzi Abdelmalek
on 3 May 2013
you can use diff function
d=diff(p(1:100))
result=d==0
out=sum(result)
tunny
on 3 May 2013
Azzi Abdelmalek
on 3 May 2013
Edited: Azzi Abdelmalek
on 3 May 2013
Yes
p=[1 4 10 18]
diff(p)=[4-1 10-4 18-10]
tunny
on 3 May 2013
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!