cubearth
cubearth

Reputation: 1153

Index exceeds matrix dimensions in Matlab

I am trying out some matlab code straight from the matlab documentation, but when I paste in into a clean matlab file and run it am getting 'Index exceeds matrix dimensions.' the code is to get a user input:

reply = input('Do you want more? Y/N [Y]: ', 's');
if isempty(reply)
    reply = 'Y';
end

Upvotes: 0

Views: 3559

Answers (1)

Dennis Miles Yeh
Dennis Miles Yeh

Reputation: 11

This problem occurs if a vector in the workspace is named "input", which causes MATLAB to try and find a subvector of "input" as opposed to calling the input command...

Upvotes: 1

Related Questions