Why i can't request user sting input?

3 visualizzazioni (ultimi 30 giorni)
jy tan
jy tan il 12 Mar 2012
n = input('Enter the number of students');
for i=1:1:n
name(i) = input('What is your name? :','s');
end

Risposta accettata

Image Analyst
Image Analyst il 12 Mar 2012
Since the names may be different lengths name needs to be a cell array. Try name{i} instead of name(i).

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by