matlab - How to Have Multiple or Conditions for While Loop -
i'm trying make basic while loop swing of things matlab. i'm trying create prompt ask user if today birthday , if yes it'll wish them happy birthday , if no it'll "that's bad". can make prompts appear want unless user inputs 'yes' or 'no' continually asked if today birthday. question how create loop prompt question on , on until user inputs 'yes' or 'no'.
try this:
while 1 b = input('is today birthday? ','s'); if any(strcmpi(b,{'yes','no'})) break end end
Comments
Post a Comment