Path: news.mathworks.com!not-for-mail
From: "Sadik " <sadik.hava@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: partial fraction expansion
Date: Thu, 2 Jul 2009 02:00:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 45
Message-ID: <h2h4b3$9uj$1@fred.mathworks.com>
References: <h2gu4a$ao6$1@fred.mathworks.com>
Reply-To: "Sadik " <sadik.hava@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246500003 10195 172.30.248.37 (2 Jul 2009 02:00:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 2 Jul 2009 02:00:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1666517
Xref: news.mathworks.com comp.soft-sys.matlab:552256


Hi Dasha,

The problem is that, in the rest of the error message, it says:

Error in ==> roots at 23
r = zeros(0,1,class(c));  

Error in ==> residue at 89
r = roots(v); 

I typed 

dbstop if error

before running your code again, and I found out at the site of error that class(c) is sym rather than a numeric class like double. So you will need to substitute values for the symbols. The residue function does not seem to accept symbolic expressions like that.

Hope this helps.


"Dar'ya " <dkc8r4REMOVE_THIS@missouri.edu> wrote in message <h2gu4a$ao6$1@fred.mathworks.com>...
> Hello,
> 
> I am trying to do partial fraction expansion.
> 
> Here is what I input:
> 
> syms z Om f h b c d g
> 
> num=[z*Om, z*Om*f, z*Om*h];
> 
> den=[1, b+f, h+b*f+c+Om^2, b*h+c*f+Om^2*f+Om^2*b, c*h-d*g+Om^2*h+Om^2*b*f+Om^2*c, Om^2*b*h+Om^2*c*f, Om^2*c*h-Om^2*d*g];
> 
> [r,p,k]=residue(num,den)
> 
> 
> Here I get the error:
> 
> ??? Error using ==> zeros
> Trailing string input must be avalid numeric class name.
> 
> Does anyone have a suggestion?
> 
> Thanks,
> 
> Dasha