Creating a Yes/No option for my program
Show older comments
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)
KSSV
on 6 May 2020
Use strcmp to compare two strings.
strcmp(choice,'yes')
Also read about strcmpi.
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!