MATLAB: Detection of objects

MATLABzero indexing

Subscript indices must either be real positive integers or logicals

Best Answer

is 0 a "real positive integer"?
Unlike other languages, MATLAB begins indexing at 1. e.g.
x(0) => your_error
x(1) => indexes first element
Related Question