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

1 Ansicht (letzte 30 Tage)
nazim siddique
nazim siddique am 18 Mär. 2016
Kommentiert: Walter Roberson am 18 Mär. 2016
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)

Antworten (1)

Ced
Ced am 18 Mär. 2016
Bearbeitet: Ced am 18 Mär. 2016
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 Kommentare
nazim siddique
nazim siddique am 18 Mär. 2016
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 am 18 Mär. 2016
You did not indicate which line the error is being reported on.
What is the output of
which tf2ss
which ss
which logical

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by