$AB=0$ solving for matrices in MatLab

316 Views Asked by At

I have the equation $AB = 0$, where $A$ and $B$ are matrices. And I know a matrix $B$ and want to find a matrix $A$.

How can I do it in MatLab?

1

There are 1 best solutions below

0
On

Let us assume that all matrices involved are square ($n \times n$).

You have first to convert your issue by transposition :

$B^T A^T = 0$

which amounts to say :

$$B^T [V_1 |V_2|...|V_n] = [0 | 0 | ... | 0] \ \ \iff \ \ \forall i, \ \ B^T V_i=0$$

which means that all $V_i$ should belong to the kernel of $B^T$, giving a manner to build such matrices.

Particular cases :

  • a) The kernel of $B^T$ is reduced to $\{0\}$ : only the null matrix is possible for $A$.

  • b) The kernel of $B^T$ has dimension 1, with basis $V$, then $A^T=[a_1V|a_2V|...|a_nV]$.

Let us take an example for case (b):

  B=[1 2 3
     2 2 4
     3 5 8];% matrix with rank<3, here rank(B)=2, thus dim(ker(B'))=1 
  K=null(B'); % the columns of K are a basis of the Kernel
  V=K(:,1); % in fact, in this case, V and K are identical 
  a=rand(1,3);
  A=[a(1)*V,a(2)*V,a(3)*V]';% note the transposition operator
  A*B,%test : must be zero