getting error Subscript indices must either be real positive integers or logicals.

조회 수: 1(최근 30일)
MD NASAR 2012년 6월 19일
Dear all
i write a code when i run this i got error "Subscript indices must either be real positive integers or logicals." code is as follows
function z=aa(p,a,q)
any one please tell me the solution
Thank you

채택된 답변

Nathaniel 2012년 6월 19일
I'm assuming that you are intending p to operate as a function, but maybe you are not passing in a function handle?
Matlab appears to be interpreting it as a matrix, and so p(t) evaluates to p(0), i.e., the 0th element of p, rather than "p of 0" which is what I suspect you want. Since Matlab indices are 1-based, p(0) throws the "...real positive integers or logicals" error.

추가 답변(0개)



Community Treasure Hunt

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

Start Hunting!

Translated by