Azzera filtri
Azzera filtri

How to use user input data in my code?

2 visualizzazioni (ultimi 30 giorni)
Sandy
Sandy il 8 Lug 2015
Commentato: Sandy il 8 Lug 2015
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.

Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su Variables in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by