Borrar filtros
Borrar filtros

Analyzing Timestamp array data

2 visualizaciones (últimos 30 días)
Hussam Ibrahim
Hussam Ibrahim el 4 de Dic. de 2017
Respondida: KSSV el 4 de Dic. de 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,

Respuestas (1)

KSSV
KSSV el 4 de Dic. de 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) ;

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by