Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

store string in array

Asked by Abdulkareem

Abdulkareem

on 5 Dec 2012
Accepted Answer by Matt Fig

Matt Fig

hi i want to input string consist of 5 char in array put i can't do that by using the command "input" because it is allow me to input only 1 char and when i input more than one error occur

1 Comment

Evan

Evan

on 5 Dec 2012

Can you please include some example code that reproduces your problem? I'm not having any issues doing what you're describing, but it may be because I'm not understanding your problem. Some sample code is always helpful when asking a question here.

The exact error message that you're receiving is also of help.

Abdulkareem

Abdulkareem

Products

No products are associated with this question.

1 Answer

Answer by Matt Fig

Matt Fig

on 5 Dec 2012
Accepted answer

What do you mean the INPUT function only lets you input one character?

>> G = input('Enter a string: ','s')
Enter a string: red
G =
red

0 Comments

Matt Fig

Matt Fig

Contact us