RGA, non-square matrix inverse

9 views (last 30 days)
Hello, I have a 2*1 matrix ( matrix=[(((64.95*s)+30)/(s^2+s+1)) (((.75*s)+396)/(s^2+s+1))] ), and for RGA calculations, I need to calculate the inverse of this matrix. When I use 'inv(matrix)' command or 'ping(matrix)' commands, matlab shows this error :
??? Error using ==> sym.svd Too many input arguments.
Error in ==> pinv at 29 [U,S,V] = svd(A,0);
Error in ==> pinv at 27 X = pinv(A',varargin{:})';
Can anyone please tell me what this error is and how can I solve it?
thank you

Accepted Answer

John D'Errico
John D'Errico on 14 Sep 2014
You can't compute the inverse of a 2x1 matrix. Period. Anyway, you almost never truly need to compute an inverse. In MATLAB, backslash is almost always a better choice, using it to solve your system.
You CAN compute a pseudo-inverse, using pinv, not ping as you say in one place. Maybe that is a source of some of your errors.
That your matrix is a symbolic one is a compicating factor, if you are doing something silly. But Icannot know that, since it works fine for me.
syms s
matrix=[(((64.95*s)+30)/(s^2+s+1)) (((.75*s)+396)/(s^2+s+1))];
pinv(matrix)
ans =
((1299*conj(s))/20 + 30)/(((((3*s)/4 + 396)*((3*conj(s))/4 + 396))/((conj(s)^2 + conj(s) + 1)*(s^2 + s + 1)) + (((1299*s)/20 + 30)*((1299*conj(s))/20 + 30))/((conj(s)^2 + conj(s) + 1)*(s^2 + s + 1)))*(conj(s)^2 + conj(s) + 1))
((3*conj(s))/4 + 396)/(((((3*s)/4 + 396)*((3*conj(s))/4 + 396))/((conj(s)^2 + conj(s) + 1)*(s^2 + s + 1)) + (((1299*s)/20 + 30)*((1299*conj(s))/20 + 30))/((conj(s)^2 + conj(s) + 1)*(s^2 + s + 1)))*(conj(s)^2 + conj(s) + 1))

More Answers (0)

Community Treasure Hunt

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

Start Hunting!