isletter true false
Mostra commenti meno recenti
How does isletter work here. Is it the value 1 that makes it executable and the value 0 that makes it not excecute and go to else?
Risposta accettata
Più risposte (2)
Wayne King
il 15 Ott 2011
0 voti
I don't see isletter() in what you've posted. I see an if statement based on the output of menu()
The menu() call you show outputs a 1,2,or 3 based on what the user selects. 1 for Cheese, 2 for Shroom, and 3 for Sausage.
If the user were to simply kill the figure window, then output would be 0.
2 Commenti
the cyclist
il 15 Ott 2011
Wayne, you need to scroll down a bit to see the relevant section he is asking about.
Wayne King
il 15 Ott 2011
@cyclist, :) oh I see
the cyclist
il 15 Ott 2011
0 voti
Basically, yes. "1" is a representation of the boolean "true", and "0" is a representation of the boolean "false". So, "if 1" means "if true", and the statement executes accordingly.
1 Commento
Tor Fredrik Hove
il 15 Ott 2011
Categorie
Scopri di più su Interactive Control and Callbacks 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!