Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

problem with operations with a for loop

Asked by 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 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.

Natalia

Tags

Products

No products are associated with this question.

0 Answers

Contact us