area under the graph
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
vijayasinthujan vijayaratnam
le 29 Mar 2012
Réponse apportée : nizar hamadeh
le 22 Sep 2015
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 ?
0 commentaires
Réponse acceptée
Wayne King
le 29 Mar 2012
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)
Plus de réponses (2)
Voir également
Catégories
En savoir plus sur Graph and Network Algorithms dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!