0

I'm sorry if this is a stupid question but I just can't find the answer I need. I have the following matrix:-

 A  |6 6 0|
    |9 0 0|

Each column represents co-ordinates on a grid. Now to find the inverse of "A" I need to create this into a 3x3 square matrix, to do this I add 001 as the 3rd row...

 B  |6 6 0|
    |9 0 0|
    |0 0 1|

I do this simply because it is what I have seen in the online examples.

My question is, what is the method to calculate/add the 3rd row of a 2x3 matrix in this situation?

DSM
  • 342,061
  • 65
  • 592
  • 494
user2292173
  • 27
  • 1
  • 1
  • 5
  • What language/environment are you using? It should be as simple as creating a row vector filled with zeros that's as long as the matrix, setting the last number in the row vector to a one, and then appending it to the matrix... – Simon M May 17 '13 at 00:38
  • I am just using some simple 2d transformations, beyond that I'm not sure what you mean by environment. Ok, would I always set the last number to 1? – user2292173 May 17 '13 at 00:43
  • I was asking what tool(s) are you using? (matlab, octave, etc) And yes, if you are always just adding a single row to the bottom of your matrix then the last number in the row should always be 1, if what you're actually doing is appending the last row of a 3x3 identity matrix. Could you link to the example that you're following? – Simon M May 17 '13 at 00:46
  • This is my own example, but say I plotted the triangle onto a graph with the co-ordinates above (A) I then multiply the point matrix (A) by the transformation matrix (1 0/0 -1) to achieve a reflection in the x axis, to reverse this operation I need to find the inverse. Hence the question. – user2292173 May 17 '13 at 00:56

2 Answers2

3

It is not possible to take the inverse of a matrix that is not squared.. I assume that would like to just extend the matrix in order to make i squared, the reason why you use the [0 0 1] is to make the matrix consistent..

Actually you matrix represent two equations with three variables..

A:

    6*x_1 + 6*x_2 + 0*x_3 = 0
    9*x_1 + 0*x_2 + 0*x_3 = 0

this is not consistent but by adding the last row you get

B:

    6*x_1 + 6*x_2 + 0*x_3 = 0
    9*x_1 + 0*x_2 + 0*x_3 = 0
    0*x_1 + 0*x_2 + 1*x_3 = 0

this matrix exists on echelon form

[1 0 0]
[0 1 0]
[0 0 1]

so by adding the last row you are not changing the matrix

you would properly get same result just by reduce it to

[6 6]
[9 0]
Laplace
  • 252
  • 2
  • 10
0

Here is a simple way to do it:

s = size(A);
B = eye(max(s));
B(1:s(1),1:s(2)) = A
Dennis Jaheruddin
  • 21,208
  • 8
  • 66
  • 122