Can waitforbuttonpress function be used with switch cases..?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Nipjyoti Sarma
am 21 Okt. 2016
Kommentiert: Nipjyoti Sarma
am 21 Okt. 2016
I have used this piece of Code but it's not working. Can you help me where I am wrong here.. for i=1:10 keydown = waitforbuttonpress; switch keydown case'0' disp(5); case'1' disp(6); end end Thank you.
0 Kommentare
Akzeptierte Antwort
Massimo Zanetti
am 21 Okt. 2016
Output of waitfrobuttonpress is not a string, is number:
for i=1:10
keydown = waitforbuttonpress;
switch keydown
case 0
disp(5);
case 1
disp(6);
end
end
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Timing and presenting 2D and 3D stimuli 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!