How to use user input data in my code?

2 次查看(过去 30 天)
I'd ask the user to input a station name. Example:
prompt = 'What is the station name?'
name = input(prompt);
Then I'd use the input in my code. Example
load name.txt
Where name is the station name they just input.
Thanks in advance.

采纳的回答

James Tursa
James Tursa 2015-7-8
name = input(prompt,'s');
load([name '.txt'])

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by