フィルターのクリア

How to use user input data in my code?

1 回表示 (過去 30 日間)
Sandy
Sandy 2015 年 7 月 8 日
コメント済み: Sandy 2015 年 7 月 8 日
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'])
  1 件のコメント
Sandy
Sandy 2015 年 7 月 8 日
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVariables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by