Azzera filtri
Azzera filtri

Analyzing Timestamp array data

2 visualizzazioni (ultimi 30 giorni)
Hussam Ibrahim
Hussam Ibrahim il 4 Dic 2017
Risposto: KSSV il 4 Dic 2017
I have an array of 1x2 million timestamps, and I want to analyze this data by better viewing them. I want to have a slider (say every 0.001 seconds), and check how many stamps fall in each 0.001 second range.
e.g. dataArray = [0.0001 0.0005 0.0009 0.001 0.0012 0.0018] resultArray = [4 2] because first 4 elements are between 0 and 0.001, and last 2 are between 0.001 and 0.002. I am also trying to make this as fast as possible since I have million data points.
Best,

Risposte (1)

KSSV
KSSV il 4 Dic 2017
dataArray = [0.0001 0.0005 0.0009 0.001 0.0012 0.0018] ;
t0 = 0. ; t1 = 0.001 ;
dt = 0.001 ;
idx = cell(2,1) ;
for i = 1:2
idx{i} = find(dataArray > t0 & dataArray <= t1) ;
t0 = t0+dt ; t1 = t1+dt ;
end
iwant = cellfun(@nnz,idx) ;

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by