MATLAB: “length” doesnt work

length

Hi
I have the following problem:
>> x = [1 2 3]
x =
1 2 3
>> length(x)
Index exceeds matrix dimensions.
????

Best Answer

clear length
x=[1 2 3]
length(x)
% Maybe you've used length as a variable
Related Question