Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
partial fraction expansion

Subject: partial fraction expansion

From: Dar'ya

Date: 2 Jul, 2009 00:14:02

Message: 1 of 2

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

Subject: partial fraction expansion

From: Sadik

Date: 2 Jul, 2009 02:00:03

Message: 2 of 2

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

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us