Move to next and previous iteration in for loop on button press
Ältere Kommentare anzeigen
Hello,
I am playing a video inside a for loop (for frame = startframe:endframe) and the image updates for each iteration in the for loop.
I want the user to be able to move forward and backward inside the loop depending on which button is pressed. Say "left arrow key" moves to previous iteration and "right arrow key" moves to next iteration.
How can I do this?
Thanks!
Antworten (1)
%Right
for i = 1:10
fprintf('%d\n',i)
end
% Left
for i = 10:-1:1
fprintf('%d\n',i)
end
3 Kommentare
Konvictus177
am 13 Okt. 2021
Bearbeitet: Konvictus177
am 13 Okt. 2021
KSSV
am 13 Okt. 2021
When you press the button get the values or some number and then decide whether to go left or right.
Konvictus177
am 13 Okt. 2021
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!