??? subscript indices must either be real positive integers or logicals

조회 수: 3 (최근 30일)
nazim siddique
nazim siddique 2016년 3월 18일
댓글: Walter Roberson 2016년 3월 18일
please help fixing this issue
numg = [1 2]
deng = [1 6 13 17 10 2]
[a,b,c,d] = tf2ss(numg,deng)
sys = ss(a,b,c,d)

답변 (1개)

Ced
Ced 2016년 3월 18일
편집: Ced 2016년 3월 18일
I have no problem running this code. You probably have a variable called ss somewhere which overshadows the function of the same name. You need to rename or delete it.
Since a has negative elements, it tries to access negative elements of ss, and throws that error.
  댓글 수: 2
nazim siddique
nazim siddique 2016년 3월 18일
there is no variable named ss in my code i think the original problem is with "a" i have tried using the command logical(a) but there is another error ??? index exceeds matrix dimensions
Walter Roberson
Walter Roberson 2016년 3월 18일
You did not indicate which line the error is being reported on.
What is the output of
which tf2ss
which ss
which logical

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by