How do I juxtapose the two plots so that the circles indicating the peak amplitude is in contrast with the plot?
Afficher commentaires plus anciens
How do I juxtapose the two plots so that the circles indicating the peak amplitude is in contrast with the plot?
figure (5), plot(t,Ca,'Color','r'), ylabel('Ca (mM)'), xlabel('Time (ms)')
[pks,locs] = findpeaks(Ca)
hold on;
plot(locs,pks,'o');

1 commentaire
Turlough Hughes
le 1 Fév 2022
Please use a smaller image of the figure to make your question more legible. If you click "edit" on your question you can easily adjust the size there.
Réponse acceptée
Plus de réponses (1)
You need to include t in your call to findpeaks. For example:
t = linspace(0,1,1000);
Ca = t./exp(t).*(1-sin(2*pi*t*20));
plot(t,Ca)
[pks,locs] = findpeaks(Ca,t);
hold on;
plot(locs,pks,'o');
Catégories
En savoir plus sur Descriptive Statistics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
