MATLAB: I can’t request user sting input

input

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

Best Answer

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