Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Orthonormal basis for null space of a matrix with complex and random elements

Subject: Orthonormal basis for null space of a matrix with complex and random elements

From: Maya

Date: 15 Jun, 2013 14:37:11

Message: 1 of 3

Hi,

I want to ask how can I find the orthonormal basis for the null space of a matrix whose elements are random and complex? I have tried with null() but I get Empty matrix: 2-by-0.

Thank you,
Maya

Subject: Orthonormal basis for null space of a matrix with complex and random elements

From: Bruno Luong

Date: 16 Jun, 2013 07:41:11

Message: 2 of 3

"Maya" wrote in message <kphu6n$il7$1@newscl01ah.mathworks.com>...
> Hi,
>
> I want to ask how can I find the orthonormal basis for the null space of a matrix whose elements are random and complex? I have tried with null() but I get Empty matrix: 2-by-0.

That might be a correct answer.

It works for me

>> A=rand(2,3)+1i*rand(2,3)

A =

   0.6948 + 0.7655i 0.9502 + 0.1869i 0.4387 + 0.4456i
   0.3171 + 0.7952i 0.0344 + 0.4898i 0.3816 + 0.6463i

>> A(end+1,:) = rand(1,2)*A

A =

   0.6948 + 0.7655i 0.9502 + 0.1869i 0.4387 + 0.4456i
   0.3171 + 0.7952i 0.0344 + 0.4898i 0.3816 + 0.6463i
   0.7322 + 1.1432i 0.7001 + 0.5022i 0.5992 + 0.8038i

>> null(A)

ans =

  -0.6626 + 0.0000i
   0.1763 + 0.1934i
   0.7001 - 0.0489i


% Bruno

Subject: Orthonormal basis for null space of a matrix with complex and random elements

From: Josh Meyer

Date: 17 Jun, 2013 17:36:47

Message: 3 of 3

"Maya " <sanja_angelova@hotmail.com> wrote in message
news:kphu6n$il7$1@newscl01ah.mathworks.com...
> Hi,
>
> I want to ask how can I find the orthonormal basis for the null space of a
> matrix whose elements are random and complex? I have tried with null() but
> I get Empty matrix: 2-by-0.
>
> Thank you,
> Maya

Notice that the basis for the null space is obtained from a singular value
decomposition using [U,S,V] = svd(A). The first r = rank(A) columns of U
form an orthonormal basis for the range of A, and when A is rank-deficient,
the last columns of V corresponding to vanishing (zero) singular values of A
span the null space of A.

It is not a coincidence that if A is an m by n matrix, rank(A) + nullity(A)
= n, the number of columns in A.

What this means is that if A is full rank, rank(A) = n, then nullity(A) = 0,
which is what you're experiencing:

%Specify a full rank matrix
A = [1 0 1;-1 -2 0; 0 1 -1];

%Find the rank
r = rank(A)
r =

     3

%Find an orthonormal basis for the range
Q = orth(A)

Q =

   -0.1200 -0.8097 0.5744
    0.9018 0.1531 0.4042
   -0.4153 0.5665 0.7118

%Attempt to find an orthonormal basis for the null space
Z = null(A)

Z =

   Empty matrix: 3-by-0

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us