Detection of objects

Subscript indices must either be real positive integers or logicals

 采纳的回答

Sean de Wolski
Sean de Wolski 2011-2-4

0 个投票

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

更多回答(1 个)

Vieniava
Vieniava 2011-2-4

0 个投票

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

类别

帮助中心File Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by