can any one tell how this break function works in this loop??
Mostra commenti meno recenti
can any one tell me how the break functions if there are two if conditions in a for loop ...
if true
% code
end
locs_Qwave=[ 100 150 90 1175 1 50]';
locs_Rwave=[116 170]';
q=0
k=1
for j=k:size(locs_Rwave)
for i=1:numel(locs_Qwave)
if (i== numel(locs_Qwave))
q=[q locs_Qwave(i)];
break;
end
if( locs_Qwave(i)>locs_Rwave(j))
q=[q locs_Qwave(i-1)];
break;
end
end
end
Risposta accettata
Più risposte (1)
Image Analyst
il 15 Set 2014
0 voti
It looks like it should function. What's the problem? If either of those two conditions is met, it breaks out of the "i" for loop and continues on with the "j" for loop.
1 Commento
Abhishek sadasivan
il 15 Set 2014
Categorie
Scopri di più su Programming in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!