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