How to find the maximum value of the power and its position on the time axis (x,y)?

4 vues (au cours des 30 derniers jours)
David
David le 15 Jan 2023
Commenté : Image Analyst le 27 Jan 2023
Need your help guys !
Need to find the max and the min of p , shown as [x,y].

Réponses (1)

Torsten
Torsten le 15 Jan 2023
Modifié(e) : Torsten le 15 Jan 2023
s=1.25;
t1=0:0.01:pi/2;
t2=pi/2:0.01:pi;
t=[t1 t2];
p1= 4*(sin(2*t1)).^2.*exp(-t1/s).^2 + 2;
p2= 4*(sin(2*t2)).^2.*exp(-t2/s) + 2;
[~,i1_min] = min(p1);
[~,i1_max] = max(p1);
[~,i2_min] = min(p2);
[~,i2_max] = max(p2);
figure()
hold on
plot([t1 t2],[p1 p2])
plot(t1(i1_min),p1(i1_min),'o',"Color","r")
plot(t1(i1_max),p1(i1_max),'o',"Color","r")
plot(t2(i2_min),p2(i2_min),'o',"Color","r")
plot(t2(i2_max),p2(i2_max),'o',"Color","r")
hold off
  2 commentaires
David
David le 15 Jan 2023
Thank you !
appreciate it !
Image Analyst
Image Analyst le 27 Jan 2023
If this Answer solves your original question, then could you please click the "Accept this answer" link to award the answerer with "reputation points" for their efforts in helping you? They'd appreciate it. Thanks in advance. 🙂 Note: you can only accept one answer (so pick the best one) but you can click the "Vote" icon for as many Answers as you want. Voting for an answer will also award reputation points.
By the way, you might look at findpeaks

Connectez-vous pour commenter.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by