Find max value in polyfit

18 ビュー (過去 30 日間)
rockstar49
rockstar49 2022 年 9 月 20 日
編集済み: Matt J 2022 年 9 月 20 日
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 日
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 件のコメント
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by