findpeaks exceeding index dimensions

3 visualizaciones (últimos 30 días)
Douglas Miller
Douglas Miller el 3 de Oct. de 2015
Respondida: Star Strider el 3 de Oct. de 2015
Hello,
I'm having trouble using findpeaks on the follwing image inserted. Here's the code I'm using currently:
importdata('ctrl2415.m')
figure; plot(Clock, intensity')
xlabel('Time (sec)'); ylabel('Intensity')
[PKS,LOCS] = findpeaks(intensity(:,1));
[PKS2,LOCS2] = findpeaks(smooth_trace);
idx_to_peak = find(PKS2 >= 0);
hold on; plot(Clock(LOCS2(idx_to_peak)), PKS2(idx_to_peak), 'co')
To walk through the code, the file imported is fluoresence data from 12 total cells for approximately 230 seconds. However, when I run the second half, I get the error Index exceeds dimensions. I'm not sure how to adjust the values for the code to function properly. Any help is greatly appreciated.
-Doug

Respuestas (1)

Star Strider
Star Strider el 3 de Oct. de 2015
What is the size of ‘smooth_trace’? It doesn’t appear to be defined in your code. (The findpeaks function may be a curious about it as the rest of us.) Also, findpeaks has a number of quite useful ‘name-value pair’ arguments that would likely make the find call unnecessary.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by