Creating a Yes/No option for my program

I have a program that has 3 options with the fourth option being the exit program option. It then asks the user if they are sure, if the user hits yes it leaves a farewell message. If the user hits no, it should restart the program. How can I edit my code so that is the user picks no, it will rerun the entire program?

Answers (1)

Use strcmp to compare two strings.
strcmp(choice,'yes')
Also read about strcmpi.

Categories

Asked:

on 6 May 2020

Answered:

on 6 May 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!