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:
Null space, empty matrix 5-by-0 error

Subject: Null space, empty matrix 5-by-0 error

From: Alan`

Date: 5 Jun, 2011 18:15:04

Message: 1 of 3

so i'm making this program to find the basis for the null space of A and B where B=A tranpose
>> in put
function projecttwo (y,o,u,r,U,F,i,d)
A=[ 1 2 3 4 5 6 7 8; 1 4 9 16 25 36 49 64; 1 8 27 64 125 216 343 512; 1 16 81 256 625 1296 2401 4096; y o u r U F i d];
B=A.';
%null spaces of A and B

nullA=null(A)
nullB=null(double(B))

end

>>output after entering my the last row

nullA =

   -0.0967 -0.4142 -0.5271
   -0.0002 0.1666 0.7011
    0.0710 0.2073 -0.1526
    0.3056 0.2041 -0.3503
   -0.7254 -0.3303 0.1168
    0.5755 -0.4105 0.2112
   -0.1858 0.6293 -0.1595
    0.0170 -0.2060 0.0312


nullB =

   Empty matrix: 5-by-0
when i go run the program, nullB appears as empty matrix 5 by 0 so i'm trying to figure out what i can do to fix this. In my class they don't really teach us Matlab, it's a linear algebra class so we gotta do all the learning on our own. Thanks for he help in advance.

Subject: Null space, empty matrix 5-by-0 error

From: Roger Stafford

Date: 5 Jun, 2011 19:01:04

Message: 2 of 3

"Alan`" wrote in message <isgh38$ils$1@newscl01ah.mathworks.com>...
> so i'm making this program to find the basis for the null space of A and B where B=A tranpose
> >> in put
> function projecttwo (y,o,u,r,U,F,i,d)
> A=[ 1 2 3 4 5 6 7 8; 1 4 9 16 25 36 49 64; 1 8 27 64 125 216 343 512; 1 16 81 256 625 1296 2401 4096; y o u r U F i d];
> B=A.';
> %null spaces of A and B
>
> nullA=null(A)
> nullB=null(double(B))
>
> end
>
> >>output after entering my the last row
>
> nullA =
>
> -0.0967 -0.4142 -0.5271
> -0.0002 0.1666 0.7011
> 0.0710 0.2073 -0.1526
> 0.3056 0.2041 -0.3503
> -0.7254 -0.3303 0.1168
> 0.5755 -0.4105 0.2112
> -0.1858 0.6293 -0.1595
> 0.0170 -0.2060 0.0312
>
>
> nullB =
>
> Empty matrix: 5-by-0
> when i go run the program, nullB appears as empty matrix 5 by 0 so i'm trying to figure out what i can do to fix this. In my class they don't really teach us Matlab, it's a linear algebra class so we gotta do all the learning on our own. Thanks for he help in advance.
- - - - - - - - - -
  There should be no surprise that the 8 by 5 array B has an empty null space. It has eight 5-element row vectors and they can easily span all of R^5 as they do here and therefore leave an empty null space. Why do you question that?

  With the 5 by 8 array A the situation is different. It has only five 8-element row vectors and it would take at least three more vectors to span R^8, as you found out.

  For the 'null' function the rows are the spanning vectors and the space to be spanned is R^n where n is the number of columns.

Roger Stafford

Subject: Null space, empty matrix 5-by-0 error

From: Roger Stafford

Date: 5 Jun, 2011 20:47:05

Message: 3 of 3

"Alan`" wrote in message <isgh38$ils$1@newscl01ah.mathworks.com>...
> so i'm making this program to find the basis for the null space of A and B where B=A tranpose
> ...........
> when i go run the program, nullB appears as empty matrix 5 by 0 so i'm trying to figure out what i can do to fix this. In my class they don't really teach us Matlab, it's a linear algebra class so we gotta do all the learning on our own. Thanks for he help in advance.
- - - - - - - - - - -
  I have just been rereading the documentation for matlab's 'null' function, and I don't wonder that you have been confused about it, Alan. It definitely needs improvement.

  For their p by n input argument, A, each of the p rows is considered a vector in R^n or C^n space. For the n by q output argument, Z, each column is considered a vector in R^n or C^n space and these are to constitute an orthonormal basis for the null space of the p rows of A. If the rows of A are linearly independent, then q = n-p, and otherwise q is greater than that depending on the degree of dependency among the A rows.

  This is implicit in their requirements, A*Z = 0 (or, as they delicately phrased it, "negligible elements") and Z'*Z = I, but Mathworks really should have made that much more clear.

  I think I have worn out my welcome in Mathworks' documentation department with my numerous complaints about various functions in the past, but if their description of 'null' did confuse you, I would advise your voicing a complaint to them about it.

Roger Stafford

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