Retrieving elements of a cell array at regular set intervals

4 次查看(过去 30 天)
Hey all! I'm currently working on a project where I have a cell array called spiketimes. Spiketimes basically contains information on when a particular spike (from a neural recording) occurs. As a result ,all the elements of the spiketimes cell array contains time points say 0.1 secs, 0.2145 secs and can go upto 4.27 secs etc. So for that particular timepoint, a spike occurs and counts as 1 count of a spike. Now what I want is to count the number of spikes for every 0.1 secs from the cell array. In other words I want to count the number of elements of the cell array between 0.1 and 0.2, 0.2 and 0.3 and so on till the last element of the array. What might be the best way to go about it?
Thanks in advance!

回答(1 个)

Swatantra Mahato
Swatantra Mahato 2021-7-8
编辑:Swatantra Mahato 2021-7-8
Hi,
It is my understanding that you want to determine the number of elements in your array that meet a certain condition. In this case, you may want to look into logical indexing on arrays in MATLAB.
You can refer the documentation link below to get started on logical indexing
Note that, you may need to convert your cell array into a matrix using the "cell2mat" function in order to use logical operators.
Hope this helps

类别

Help CenterFile Exchange 中查找有关 Multirate Signal Processing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by