This keeps coming up as an error, what am I doing wrong?
prompt= 'State your name, Your Grace ';
name=input(prompt);

 Akzeptierte Antwort

Chad Greene
Chad Greene am 8 Nov. 2015

14 Stimmen

I think you want
name=input(prompt,'s');
to specify a string.

2 Kommentare

Somil Ajmera
Somil Ajmera am 23 Okt. 2020
Thank you
Joseph Armstrong
Joseph Armstrong am 11 Dez. 2020
Thanks been trying to solve this 's' needed to be in thanks so much

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

k khaja
k khaja am 7 Mär. 2021

0 Stimmen

Hi,
Can anyone please show me, after prompt the user input, how can I append the strings in same cell,
Thanks in advanvce.

3 Kommentare

Not sure what you are asking.
N = 5;
ins = cell(N,1);
for K = 1 : ins
ins{K} = input(sprintf('enter input #%d', K), 's');
end
strjoin(ins, ', ')
victoria thomas
victoria thomas am 23 Jun. 2021
Bearbeitet: Walter Roberson am 24 Jun. 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
Walter Roberson am 24 Jun. 2021
I do not see how that code is a solution to any topic that was being discussed here?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by