Prompt user for a text string
372 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Krish Desai
el 8 de Nov. de 2015
Comentada: Walter Roberson
el 24 de Jun. de 2021
This keeps coming up as an error, what am I doing wrong?
prompt= 'State your name, Your Grace ';
name=input(prompt);
0 comentarios
Respuesta aceptada
Chad Greene
el 8 de Nov. de 2015
I think you want
name=input(prompt,'s');
to specify a string.
2 comentarios
Joseph Armstrong
el 11 de Dic. de 2020
Thanks been trying to solve this 's' needed to be in thanks so much
Más respuestas (1)
k khaja
el 7 de Mzo. de 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 comentarios
victoria thomas
el 23 de Jun. de 2021
Editada: Walter Roberson
el 24 de Jun. de 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
el 24 de Jun. de 2021
I do not see how that code is a solution to any topic that was being discussed here?
Ver también
Categorías
Más información sobre Characters and Strings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!