Count frequency of number in set time period
古いコメントを表示
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!
回答 (1 件)
Matt Fig
2011 年 5 月 31 日
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)
カテゴリ
ヘルプ センター および File Exchange で Control System Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!