MATLAB Answers

0

Error using length() command ??

Asked by Siddhant Raman on 26 Jan 2013
I typed these lines in the command window and got the error message . Any idea why is this happening ??
>> mychar = input('Enter any Character : ','s')
Enter any Character : r
mychar =
r
>> length(mychar)
??? Index exceeds matrix dimensions.

  0 Comments

Sign in to comment.

1 Answer

Answer by Evgeny Pr on 26 Jan 2013

You redefined LENGTH?
For example:
length = []
length('r')
Index exceeds matrix dimensions.
which('length')
length is a variable.
Must be:
which('length')
built-in (<matlabroot>\toolbox\matlab\elmat\length)

  0 Comments

Sign in to comment.