フィルターのクリア

How to get equation from each plot?

82 ビュー (過去 30 日間)
Okinawa Rikenata
Okinawa Rikenata 2018 年 1 月 25 日
コメント済み: Okinawa Rikenata 2018 年 1 月 25 日
So I have this code:
wkt is 117*1 array
x is also 117*1 array
a=polyfit(wkt,x);
b=polyval(a,wkt);
figure
plot (wkt,x)
hold on
plot (wkt,b)
Then I get a figure with 2 different plots. My problem is how to get the equation for each plot so I can evaluate the area between 2 curves. If I use this
a=trapz(wkt,x)-trapz(wkt,b)
will I get a correct result? Or is there another way? Thank you.

採用された回答

Walter Roberson
Walter Roberson 2018 年 1 月 25 日
https://www.mathworks.com/help/matlab/ref/polyint.html polyint will integrate directly from the polynomial coefficients.
  1 件のコメント
Okinawa Rikenata
Okinawa Rikenata 2018 年 1 月 25 日
Ahh thankyou so much!!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by