How to introduce a array of text in matlab

Hi everyone , i have to ask , how i can introduce a array of string in matlab, like in java, for example string i=input('Give me your name'); what is the correct sintaxis , pliz i need your help
Thx

 Accepted Answer

Use the following a few examples:
str1='this is my string'
StrCell2={'a','bd';'eft','aldjfal'}
s=input('please type in a string:\n','s')

1 Comment

thank you, but i have to introduce the array from keyboard in execution time
s=input('please type in a string:\n','s') this statement just allow me introduce one character but i have to introduce for example "Jennifer"

Sign in to comment.

More Answers (1)

s=input('please type in a string:\n','s') this statement just allow me introduce one character but i have to introduce for example "Jennifer"

1 Comment

No, that statement stores all of the characters.
Note that in MATLAB, there is no string data type, and that strings are considered arrays of characters. If you were to use s(1) you would not be asking for the first string in s, you would be asking for the first character in s.

Sign in to comment.

Categories

Community Treasure Hunt

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

Start Hunting!