Hi all , i am confuse about how to take a city name into a variable through "input" command . Here i want to take London city name .please correct this code .Error using input Undefined function or variable 'London'.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Enayat Ansari
le 31 Déc 2016
Modifié(e) : Stephen23
le 31 Déc 2016
city=input('Enter your city'); disp(city);
0 commentaires
Réponse acceptée
Stephen23
le 31 Déc 2016
Modifié(e) : Stephen23
le 31 Déc 2016
The great thing about MATLAB is the documentation. It means that we do not need to guess how to use MATLAB. You should read the input documentation, and then you would learn to use the 's' option to keep the input as a string (and not evaluate it):
str = input('Enter your city: ','s');
disp(str)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Time Series Events 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!