Like to find the max value of this polyfit
tmp1=abs(FRF);
q1 = polyfit(f(f>0 & f <50),tmp1(f>0 & f <50),4);
z1 = polyval(q1,f);
plot(f(f>0 & f <50),z1(f>0 & f <50))

답변 (1개)

Matt J
Matt J 2022년 9월 20일
편집: Matt J 2022년 9월 20일

1 개 추천

xcrit=roots(polyder(q1)); %set derivatives to 0
xcrit(imag(xcrit)~=0)=[]; %get rid of non-real solutions
zmax=max( polyval(q1, [0,xcrit',50]) ); %take max over critical points.

댓글 수: 3

rockstar49
rockstar49 2022년 9월 20일
이동: Matt J 2022년 9월 20일
this almost worked, however recieved this error for the last line
Torsten
Torsten 2022년 9월 20일
이동: Matt J 2022년 9월 20일
q1 as argument to polyval is missing.
Matt J
Matt J 2022년 9월 20일
이동: Matt J 2022년 9월 20일
Yes, I fixed it.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2017a

질문:

2022년 9월 20일

편집:

2022년 9월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by