Borrar filtros
Borrar filtros

Can I associate one vector with another one?

1 visualización (últimos 30 días)
Mohammad Ayoub
Mohammad Ayoub el 23 de Mzo. de 2017
Editada: Mohammad Ayoub el 23 de Mzo. de 2017
I used the MATLAB function [r,p,k] = residue(num,den). For example assume:
num = [1 4];
den = [1 6 11 6];
[r,p,k] = residue(num,den)
This gives:
r = [0.5;-2.0;1.5]
p = [-3.0;-2.0;-1.0]
0.5 is the coefficient for the partial fraction expansion, which is associated with the pole -3
-2 is associated with -2, and 1.5 is associated with -1.
The question is, is there a way to make changes to matrix p apply to r? For example if I swap -3 and -2 in p, this would swap 0.5 and -2 in r automatically. (The only change I want to apply is swapping elements, no operations on elements or adding extra elements.)
Thank you in advance.
Regards, M Ayoub.

Respuestas (1)

Adam
Adam el 23 de Mzo. de 2017
Editada: Adam el 23 de Mzo. de 2017
There is no automatic way of doing this, you would have to apply to same swap indices yourself.
If you merge them into a single matrix though as
[r, p']
then you only need to do a single swap operation on a full row. If you wish you can them separate them back out into individual variables afterwards.

Categorías

Más información sobre Interpolation of 2-D Selections in 3-D Grids en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by