How can I store user input

25 次查看(过去 30 天)
John Laple
John Laple 2021-12-2
player_x = 1;
r = input('select a row');
c = input('select a column');
tictactoe_board(r,c) = player_x

回答(1 个)

KALYAN ACHARJYA
KALYAN ACHARJYA 2021-12-2
编辑:KALYAN ACHARJYA 2021-12-2
There are multiple ways (Any One)
  1. Store the r and c variable data in text file or other files, like excel (see save function)
  2. Easiest: diary on, display the user data in command window, once done diary off, it save all reflects data in command window in one text file.
If user data has multiple repetitions, prefer to save in an array, then save the array variable in text file or excel.
Hope it Helps!

类别

Help CenterFile Exchange 中查找有关 Strategy & Logic 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by