MATLAB: How do i calculate the inverse of a non-square matrix

matrix manipulation

I have a 4×3 matrix(S) and i want to calculate the inverse of it, the matrix is:
S=
1.7530 0 0 0
0 0.1009 0 0
0 0 0.0149 0
but since it is not a square matrix when i use S^-1 it says i have to use elemental wise power. The problem is when i use elemental-wise power the zeros go to 'Inf' so what do i do?

Best Answer

Typically one would use backslash \ or perhaps pinv( ) for this. What are you using this for? I.e., what is the problem you are solving and what are you doing with the result downstream in your code?
Related Question