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:
Populating a matrix without using loops

Subject: Populating a matrix without using loops

From: Amz Obi

Date: 9 May, 2009 17:50:03

Message: 1 of 2

Hello all,

I'm trying to populate a sylvester matrix, S(a,b) given two polynomials of the form

p(x) = a(1)*x^n + ... + a(n)*x + a(n+1)
q(x) = b(1)*x^m + ...+ b(m)*x + b(m+1)

in MATLAB however I'm not allowed to use any loops, does anyone have any ideas how I can do this without using loops?
I am allowed to use the toeplitz function though.


Kind regards
Amz

Subject: Populating a matrix without using loops

From: Srikanth

Date: 9 May, 2009 18:03:45

Message: 2 of 2

On May 9, 10:50 am, "Amz Obi" <a...@mathworks.com> wrote:
> Hello all,
>
> I'm trying to populate a sylvester matrix, S(a,b)  given two polynomial=
s of the form
>
> p(x) = a(1)*x^n + ... + a(n)*x + a(n+1)
> q(x) = b(1)*x^m + ...+ b(m)*x + b(m+1)
>
> in MATLAB however I'm not allowed to use any loops, does anyone have any =
ideas how I can do this without using loops?
> I am allowed to use the toeplitz function though.
>
> Kind regards
> Amz

Use two toeplitz matrics and concatenate them. For example do toeplitz
([0 ... 0 a(1) a(2)... a(n+1)]) and similarly for q. Now partition the
resulting matrices to take out the block you want from each and
concatenate them.
hth

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