how to recived input user in matlab

1 Ansicht (letzte 30 Tage)
Shehab Tarek
Shehab Tarek am 29 Mai 2020
Beantwortet: Rik am 29 Mai 2020
i want to recived the word from the user and restore each charater
for example
string=input('enter the string>>');
-- shehab
0=s
1=h
2=e
and so on

Akzeptierte Antwort

Rik
Rik am 29 Mai 2020
You need to specify that you want the result as a char array:
str=input('enter the string>>','s');
It is also a good idea to develop the habit of avoiding builtin Matlab names.

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help 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