Count frequency of number in set time period
Mostrar comentarios más antiguos
I have what I hope is a relatively simple problem. I have a variable that records coded responses, and a time variable which records when these responses occurred. I would like to find out the frequencies of particular numbers during a specified time period. For instance, how many 1's are recorded during 6sec - 30secs.
Is there a function I can run that operates like counts if number = 1 and time is >6 and <30?
Thanks for any help!
Respuestas (1)
Matt Fig
el 31 de Mayo de 2011
responses = round(rand(1,10)*2) % An example data set
times = 1:10; % Example time set...
% Count responses equal to 1 in a certain time range.
counts = sum(responses(times>3 & times<9)==1)
Categorías
Más información sobre Control System Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!