help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a(a>1) returns 1-D list, also for matrix. Can it be done per column?


From: indium
Subject: a(a>1) returns 1-D list, also for matrix. Can it be done per column?
Date: Thu, 8 Mar 2012 21:41:54 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

Dear all,

v1=[1;0;4;56;25;10;0];
v2=[10;20;156;125;50;20;5];
m=[v1,v2];
m(m>30)

gives for m:

ans =

   5.6000e+01
   1.5600e+02
   1.2500e+02
   5.0000e+01

Can I make/use the mask "m>30" "per column", that is: for each of the (two) 
columns? 
So:

   5.6000e+01       1.5600e+02
                    1.2500e+02
                    5.0000e+01


The reason I ask this, it because I have several vectors (=columns) of data and
for each I'd like to estimate the FWHM value, by masking for each vector v
"v>max(v)/2". This gives a list, so I don't know which data belong to which
vector.

If you have only 1 column, you can do v.*(v>max(v)./2), but for more than 1 
column, it doesn't work.
 Or do I misunderstand the power of index-masks?

thanks for any suggestions!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]