MATLAB: How to use user input data in the code

loadstruser input

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.

Best Answer

name = input(prompt,'s');
load([name '.txt'])
Related Question