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:
What am I missing?

Subject: What am I missing?

From: Greg Heath

Date: 22 Nov, 2012 21:18:07

Message: 1 of 6

% help rank
%
% rank Matrix rank.
% rank(A) provides an estimate of the number of linearly
% independent rows or columns of a matrix A.
    
>>A1= round(rand(1,5))
A2 = 1-A1
A = [ A1 ; A2 ]
rankA = rank(A)

A1 = 1 0 1 1 0
A2 = 0 1 0 0 1
A = 1 0 1 1 0
          0 1 0 0 1
rankA = 2

Why isn't rankA = 1?

Greg

Subject: What am I missing?

From: Nasser M. Abbasi

Date: 22 Nov, 2012 22:00:18

Message: 2 of 6

On 11/22/2012 3:18 PM, Greg Heath wrote:
> % help rank
> %
> % rank Matrix rank.
> % rank(A) provides an estimate of the number of linearly
> % independent rows or columns of a matrix A.
>

> A = 1 0 1 1 0
> 0 1 0 0 1

> rankA = 2
>
> Why isn't rankA = 1?
>
> Greg
>

It is the maximum number of linearly independent column or rows in A.
Which is 2. For example, the first 2 columns.

--Nasser

Subject: What am I missing?

From: Nasser M. Abbasi

Date: 22 Nov, 2012 22:20:09

Message: 3 of 6

On 11/22/2012 4:00 PM, Nasser M. Abbasi wrote:
> On 11/22/2012 3:18 PM, Greg Heath wrote:
>> % help rank
>> %
>> % rank Matrix rank.
>> % rank(A) provides an estimate of the number of linearly
>> % independent rows or columns of a matrix A.
>>
>
>> A = 1 0 1 1 0
>> 0 1 0 0 1
>
>> rankA = 2
>>
>> Why isn't rankA = 1?
>>
>> Greg
>>

>
> It is the maximum number of linearly independent column or rows in A.
> Which is 2. For example, the first 2 columns.
>

hi;

follow up:


EDU>> [U,S,V] = svd(A)

U =

      1 0
      0 1

S =
     1.7321 0 0 0 0
          0 1.4142 0 0 0


V =
     0.5774 0 -0.5774 -0.5774 0
          0 0.7071 0 0 -0.7071
     0.5774 0 0.7887 -0.2113 0
     0.5774 0 -0.2113 0.7887 0
          0 0.7071 0 0 0.7071


--Nasser

Subject: What am I missing?

From: Roger Stafford

Date: 22 Nov, 2012 23:18:08

Message: 4 of 6

"Greg Heath" <heath@alumni.brown.edu> wrote in message <k8m4qf$8de$1@newscl01ah.mathworks.com>...
> >>A1= round(rand(1,5))
> A2 = 1-A1
> A = [ A1 ; A2 ]
> Why isn't rankA = 1?
- - - - - - - - -
  For A1 and A2 to be linearly dependent requires that there exist two real or complex numbers, c1 and c2, not both zero, such that c1*A1 + c2*A2 = 0. The equality A2 = 1-A1 doesn't qualify for that. In fact A1 and A2 are linearly independent since no such c1 and c2 exist. Hence the rank of A must be 2.

  Another way to see this is that the rank is the size of the largest square submatrix within A whose determinant is nonzero. Clearly this is 2.

Roger Stafford

Subject: What am I missing?

From: Bruno Luong

Date: 23 Nov, 2012 06:13:08

Message: 5 of 6

"Greg Heath" <heath@alumni.brown.edu> wrote in message <k8m4qf$8de$1@newscl01ah.mathworks.com>...
> % help rank
> %
> % rank Matrix rank.
> % rank(A) provides an estimate of the number of linearly
> % independent rows or columns of a matrix A.
>
> >>A1= round(rand(1,5))
> A2 = 1-A1

Multiply a vector (here A1) by (-1) is a linear operator, however adding 1 to a vector is not.

Thus A2 is linear independent to A1. (unless if A1 is a constant vector).

Bruno

Subject: What am I missing?

From: Greg Heath

Date: 23 Nov, 2012 22:30:08

Message: 6 of 6

"Roger Stafford" wrote in message <k8mbrg$va$1@newscl01ah.mathworks.com>...
> "Greg Heath" <heath@alumni.brown.edu> wrote in message <k8m4qf$8de$1@newscl01ah.mathworks.com>...
> > >>A1= round(rand(1,5))
> > A2 = 1-A1
> > A = [ A1 ; A2 ]
> > Why isn't rankA = 1?
> - - - - - - - - -
> For A1 and A2 to be linearly dependent requires that there exist two real or complex numbers, c1 and c2, not both zero, such that c1*A1 + c2*A2 = 0. The equality A2 = 1-A1 doesn't qualify for that.

OK!

It's hard to believe I've gotten that screwed up in my mind ... What next?

Thanks.

Greg

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