using quadl to find area between 2 curves

조회 수: 1 (최근 30일)
lowcalorie
lowcalorie 2012년 3월 25일
i need to find the area between the 2 curves using quadl and trapz i was able to do it using just trapz but im not sure how to implement quadl into my code so it will work can somebody help here is my code so far
x = linspace(0,pi);
y1 = sin(x);
y2 = abs(sin(2*x))/2;
plot(x,y1,x,y2)
grid on
set(gca,'ylim',[0 1]);
set(gca,'ytick',0:0.1:1);

채택된 답변

Wayne King
Wayne King 2012년 3월 25일
Q = quadl(@(x)sin(x)-abs(sin(2*x)/2),0,pi);
  댓글 수: 1
lowcalorie
lowcalorie 2012년 3월 25일
il give that a try thanks so much huge help

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by