필터 지우기
필터 지우기

The x-coordinates of the intersection points between the two graphs are? solx and soly

조회 수: 1 (최근 30일)
v=[2;0;1;9;0;1;3;0;1];
m=max(v);
n=mean(v);
f=@(x) m-(1/2).*x; % Vectorized
g=@(x) 2.*x.^2-n; % Vectorized
figure
ezplot(f);
hold on
ezplot(g);
hold on
syms x y
eqns=[y==m-(1/2)*x;y==2*x^2-n]; % Array and y==2 instead of y=2 in equation 2
[solx, soly]=solve(eqns,[x y]);
plot(solx(1),soly(1),'b-x',solx(2),soly(2),'b-x')
expr1=m-(1/2)*x;
expr2=2*x^2-n;
I1=int(expr1,[solx(1) solx(2)]);
I2=int(expr2,[solx(1) solx(2)]);
I=I2-I1;
fprintf('The area bounded by the two curves is: %f\n',I);
The area bounded by the two curves is: 34.022481
  댓글 수: 1
Star Strider
Star Strider 2022년 11월 14일
Is there a problem?
v=[2;0;1;9;0;1;3;0;1];
m=max(v);
n=mean(v);
f=@(x) m-(1/2).*x; % Vectorized
g=@(x) 2.*x.^2-n; % Vectorized
figure
ezplot(f);
hold on
ezplot(g);
hold on
syms x y
eqns=[y==m-(1/2)*x;y==2*x^2-n]; % Array and y==2 instead of y=2 in equation 2
[solx, soly]=solve(eqns,[x y]);
plot(solx(1),soly(1),'b-x',solx(2),soly(2),'b-x')
expr1=m-(1/2)*x;
expr2=2*x^2-n;
I1=int(expr1,[solx(1) solx(2)]);
I2=int(expr2,[solx(1) solx(2)]);
I=I2-I1;
fprintf('The area bounded by the two curves is: %f\n',I);
The area bounded by the two curves is: 34.022481
.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by