Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

help :how to implement do while loop in matlab

Status
Not open for further replies.

austinpowers

Electrical
Oct 21, 2005
25
can anyone help me with this ,
how to implement do while loop in matlab
 
Replies continue below

Recommended for you

In the MATLab command window type

help for

The information you want should be there.

jdm

"Education is what remains after one has forgotten everything he learned in school." Albert Einstein
 
or

>> help while

as the case might be.

Additionally, F1 followed by a search for "while" will pull up the help file entry including additional information

TTFN



 
Hi,
I don't think that exists a do-while in matlab, but you can use this treak

temp = 1;
while ( temp | condition )
temp = 0;
...
...
end

In such a way the first cycle is always true but from the second you remain in the while loop only if your condition is verified.
I don't know your program but pheraps you can use only condition if it is well settled at the beginning of the loop.
Hi
Gianluca
 
thanks for replying guys

Anyway i have already implemented this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor