Error using length() command ??

14 次查看(过去 30 天)
Siddhant Raman
Siddhant Raman 2013-1-26
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.

回答(1 个)

Evgeny Pr
Evgeny Pr 2013-1-26
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)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by