Clear Filters
Clear Filters

Detection of objects

2 views (last 30 days)
jyothsna chennareddy
jyothsna chennareddy on 4 Feb 2011
Subscript indices must either be real positive integers or logicals

Accepted Answer

Sean de Wolski
Sean de Wolski on 4 Feb 2011
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

More Answers (1)

Vieniava
Vieniava on 4 Feb 2011
in Matlab vector/matrix indexing starts from 1, not from 0, so you should change for-loop starting value on 1 .

Community Treasure Hunt

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

Start Hunting!