Info

This question is closed. Reopen it to edit or answer.

I need help with an if statement problem.

1 view (last 30 days)
Ian Meister
Ian Meister on 27 Nov 2015
Closed: MATLAB Answer Bot on 20 Aug 2021
I am working on a Matlab project for a class. I am still relatively new to Matlab but can somewhat comprehend a bit of it. My project is a game picker for if you want to pick a video game. I am making a smaller version of it then what it could be. It will most likely consist of a lot of if statements. Here is what I have so far:
Y=1
N=2
step1=input('Do you Want to play a game?\n Y or N\n');
If step1==N
fprintf('Then do something else because I cannot help with that')
else
step2=input('Do you know the name of the game you want to play?\n Y or N\n')
end
Any help is appreciated. I just want to be able to understand this stuff better.
Thank you
  14 Comments
Ian Meister
Ian Meister on 27 Nov 2015
I just realized that the separate genres have no meaning behind them. They're just buttons. Do I need to add a variable to the genre name and then use the variable name as the button?
Walter Roberson
Walter Roberson on 27 Nov 2015
"need"... maybe not. But it would be a good idea even if you do not need it.

Answers (0)

Community Treasure Hunt

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

Start Hunting!