I am trying to create a dialog box that asks two players for their names. I have the dialog box working fine I just need help in extracting the string that the user inputs and using fprintf to display it in the command window.
This is what I have so far, I have tried using str2num and other things I just keep getting error messages.
Here is my code:
Prompts = {'What is the name of Player 1?', 'What is the name of Player2?'}; DialogBox = inputdlg(Prompts);
Player1Name = x(1); Player2Name = x(2);
fprintf('%s = Player1', Player1Name) fprintf('%s = Player2', Player2Name)
Thank you all so much!
Best Answer