Prompt user for a text string
922 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Krish Desai
il 8 Nov 2015
Commentato: Walter Roberson
il 24 Giu 2021
This keeps coming up as an error, what am I doing wrong?
prompt= 'State your name, Your Grace ';
name=input(prompt);
0 Commenti
Risposta accettata
Più risposte (1)
k khaja
il 7 Mar 2021
Hi,
Can anyone please show me, after prompt the user input, how can I append the strings in same cell,
Thanks in advanvce.
3 Commenti
victoria thomas
il 23 Giu 2021
Modificato: Walter Roberson
il 24 Giu 2021
ais=input('Give me a letter you would like converted to a number: ','s')
alphabet=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
for k=1:1:26
if strcmp(ais,alphabet(k))==1
disp([char(ais) ' is letter ' num2str(k) ' in the alphabet!'])
end
end
Walter Roberson
il 24 Giu 2021
I do not see how that code is a solution to any topic that was being discussed here?
Vedere anche
Categorie
Scopri di più su Characters and Strings 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!