help-octave
[Top][All Lists]
Advanced

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

Vectorize an extraction


From: keithspg
Subject: Vectorize an extraction
Date: Thu, 2 Dec 2010 09:59:32 -0800 (PST)

I did not know how best to title this, but I am working on analysis of a data
set. In that set, there are values I do not want to consider nor plot as
they are zero. Currently, I am using this loop to extract the values I want
(all voltages >0.5)
                j=1;
                for i = 1:(size(data,1)-1); # extracting only loaded values loop
                if(data(i,2) > 0.5);
                loaded(j,1)=data(i,1);
                loaded(j,2)=data(i,2); 
                j=j+1;
                endif
                endfor

I was hoping to make this faster in execution by vectorizing this and am
looking for advice on how best to do it. The next steps after this are to
plot the extracted vector and calculate its mean and max. This is nested in
another loop that increments each experiment (1:16) and is nested in another
which runs from (0:1) for a step load I place on the system (0 is parasitic
load and 1 is heavily - this is taken for all 16 experiments). I do not
think these 2 loops really slow it down much, but the other does as it is
crunching through anywhere from 10000 lines to 100000 lines.

KeithG
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/Vectorize-an-extraction-tp3069827p3069827.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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