필터 지우기
필터 지우기

area under the graph

조회 수: 7 (최근 30일)
vijayasinthujan vijayaratnam
vijayasinthujan vijayaratnam 2012년 3월 29일
답변: nizar hamadeh 2015년 9월 22일
how can i colored area which is under the graph (eg y=mx+c or any graph)with the boundary condition let say x is 2-5 and find the colored area ?

채택된 답변

Wayne King
Wayne King 2012년 3월 29일
You can use fill() to color in the area under the graph of a line, and you can use a numerical integration method like quad() to compute the integral:
x = 0:0.01:1;
y = 2*x-2;
axis([0 1 -2 0]);
x1 = [0 1 1];
y1 = [-2 -2 0];
fill(x1,y1,'r');
hold on;
plot(x,y,'k','linewidth',2);
Q = quad(@(x) 2*x-2,0,1)
  댓글 수: 1
vijayasinthujan vijayaratnam
vijayasinthujan vijayaratnam 2012년 3월 29일
thank u wayne KING

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

추가 답변 (2개)

Richard
Richard 2012년 3월 29일

nizar hamadeh
nizar hamadeh 2015년 9월 22일
if auc is 0.9 how can i draw it

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by