Retrieving elements of a cell array at regular set intervals

조회 수: 2 (최근 30일)
Kevin Akash Rajasekaran
Kevin Akash Rajasekaran 2021년 7월 1일
편집: Swatantra Mahato 2021년 7월 8일
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에서 Data Type Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by