[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Zero entries in one column of a matrix
From: |
Henry F. Mollet |
Subject: |
Zero entries in one column of a matrix |
Date: |
Wed, 31 Mar 2004 10:40:05 -0800 |
User-agent: |
Microsoft-Entourage/10.1.1.2418 |
I have a matrix M with say 100 rows and 2 columns. The second columns
contains say 25 zeros.
M ( M(:,2) ~=0 , 1 ) produces 1st col without the entries when there's a
zero in the second column;
M ( M(:,2)~=0 , 2 ) produces 2nd col without the entries when there's a zero
in the second column;
I understand that M(:,2) ~=0 produces a col vector of length 100 with 1's,
whenever the statement (~=0) is true, i.e. not a zero
and produces a zero entry, whenever the statement (~=0) is false, i.e. a
zero.
But how does the elimination of the zero entries (in the second column of M)
work in
M (statement, 1) producing col vector of length 100-25=75, and
M (same statement, 2) producing col vector of length 75 also?
Henry
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Zero entries in one column of a matrix,
Henry F. Mollet <=