problem with operations with a for loop

1 view (last 30 days)
Natalia
Natalia on 18 Apr 2013
I'm performing a number of operations inside of a for loop. All the operations are being performed with the exception of the last loop.
e.g if I have within a loop something like this
for t=1:4
.....some code....
unmated=find(fem(:,3,t)==0) fem(:,8,t)=fem(:,1,t); %replacing fem(unmated,8,t)=0;
....more code... end
the operations are only performed for the first 3 loops but not for the last one.
Any ideas?
Thanks
  1 Comment
per isakson
per isakson on 18 Apr 2013
Edited: per isakson on 18 Apr 2013
It is difficult to read the code because of poor formatting. However, I cannot spot the reason why the loop is not executed for t=4. I guess, the reason is to find outside the code you show.

Sign in to comment.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!