Effacer les filtres
Effacer les filtres

How to use user input data in my code?

1 vue (au cours des 30 derniers jours)
Sandy
Sandy le 8 Juil 2015
Commenté : Sandy le 8 Juil 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.

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Variables dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by