Detection of objects

2 次查看(过去 30 天)
Subscript indices must either be real positive integers or logicals

采纳的回答

Sean de Wolski
Sean de Wolski 2011-2-4
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
in Matlab vector/matrix indexing starts from 1, not from 0, so you should change for-loop starting value on 1 .

类别

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