필터 지우기
필터 지우기

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'])

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Variables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by