Finding Closest Data Point
이전 댓글 표시
I have one matrix with data in the first column and time stamps in the second column (datamatrix.mat). The next matrix contains spiketimes (spiketimematrix.mat). I want to get the data point in the first column of first matrix that is the closest time point corresponding to the spike times in spiketimematrix.mat. For example, the first spiketime is 166.1670, which corresponds to the closet time point of 166.1696 and corresponds with the data point 2.5281.
채택된 답변
추가 답변 (1개)
Roger Stafford
2016년 10월 25일
I recommend you use the ‘pdist2’ function using the “Smallest” option. It is described at:
https://www.mathworks.com/help/stats/pdist2.html
카테고리
도움말 센터 및 File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!