How to get equation from each plot?
조회 수: 82 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
Walter Roberson
2018년 1월 25일
https://www.mathworks.com/help/matlab/ref/polyint.html polyint will integrate directly from the polynomial coefficients.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!