How to find the maximum value of the power and its position on the time axis (x,y)?
조회 수: 1 (최근 30일)
이전 댓글 표시
Need your help guys !
Need to find the max and the min of p , shown as [x,y].
댓글 수: 0
답변 (1개)
Torsten
2023년 1월 15일
편집: Torsten
2023년 1월 15일
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
Image Analyst
2023년 1월 27일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Detection에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!