prash.allu69 asked . 05/02/2020

Can we use do while loop in MATLAB?

Can we use do while loop in MATLAB?

Matlab

Expert Answer

Kshitij Singh ( Staff ) answered . 06/02/2020


while loop and for loop which are more powerful.
Please refer below snippet for while loop

while (condition)
...
end
If you want to use while loop as do while() just do below modification,
while true
% statements here
% if ~WhileCondition, break ; end
end