0

I'm evaluating a series of theoretical (not necessarily functional) circuits in matlab. I have been trying to get the transfer function of the circuits and during the process I use the sym2poly function. Sometimes, sym2poly works and returns the transfer function. Sometimes it does not.
This is what the code looks like:

        [n,d] = numden(eval(v_3/V));

        transH = tf(sym2poly(n),sym2poly(d))

n and d are symbolic cell arrays. The error I get is:

Error using sym/sym2poly (line 28)
Not a polynomial.

Error in CircuitGA (line 349)
        n = sym2poly(n);

This looks similar to several questions posted a long time ago, but all of those were solved by a bug fix in an updated version of the symbolic math toolbox. Does it mean that what I am giving it is impossible to turn into a polynomial?

Is there a fix? Any suggestions of a method that will work for all my circuit arrays?

Maybe a try and catch for if it can return a transfer function?

MJAFort
  • 23
  • 7
  • Could you provide some input data to reproduce your problem? – Daniel Jul 15 '14 at 21:14
  • I would except that it's 350 lines long. This link has a downloadable copy of the evaluation function and some example circuits: http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA6.html#Downloading A quick note: all of his circuits work for the transfer function. I'm trying to build a GA to modify the circuits for me, so they aren't all pretty. – MJAFort Jul 15 '14 at 21:43
  • 'V' [3] [1] [3] 'R' [1] [1] [0] 'R' [3] [0] [1] 'C' [1] [0] [2] 'I' [2] [0] [0] This is the one throwing the error. They are in 4 columns. – MJAFort Jul 15 '14 at 21:48

0 Answers0