Why i can't request user sting input?

n = input('Enter the number of students');
for i=1:1:n
name(i) = input('What is your name? :','s');
end

 Respuesta aceptada

Image Analyst
Image Analyst el 12 de Mzo. de 2012

0 votos

Since the names may be different lengths name needs to be a cell array. Try name{i} instead of name(i).

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 12 de Mzo. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by