how to turn back into a loop after using Break command in the loop
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I wanna use 'break' command in a loop, when it goes out of the loop, I want it turn back into the loop. Is there a way to make it happen?
Thanks in advance
3 Kommentare
Guillaume
am 20 Jul. 2019
I used for loop but you know it's just giving me the latest bit
Start a new question, explaining a lot better what it is you're trying to, with examples. Show us the relevant part of your code and if you get any error, the full text of the error.
Antworten (2)
KALYAN ACHARJYA
am 20 Jul. 2019
Bearbeitet: KALYAN ACHARJYA
am 20 Jul. 2019
Suppose you create a custom function to read the individual bit. like as follow-
%#Read the data
function bit_out=data_bit(i,j)
mat_data= %input logical matrix
bit_out=mat_data(i,j);
end
Next call the function for different values of i,j
%# Call the read data and send
data=data_bit(i,j);
%send data
%Change i,j, you may required loop and do again
0 Kommentare
Walter Roberson
am 20 Jul. 2019
No, there is no way to do that in the way stated. Once a loop is exited, the only way to get inside it again is to start it over.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!