Area in a function
조회 수: 7 (최근 30일)
이전 댓글 표시
Im trying to fill the area under a function but I dont know how to exactly do it, I want to plot the area between [-1, 1]
syms f(x)
f=1-x^4
t=0
I=int(f)
Area=subs(I,1)-subs(I,-1)
fplot(f,[-1,1])
hold on
fplot(t,'b')
댓글 수: 0
답변 (1개)
David Hill
2022년 1월 26일
x=-1:.001:1;
f=1-x.^4;
g=zeros(size(x));
plot(x,g,x,f);
x2 = [x, fliplr(x)];
inBetween = [g, fliplr(f)];
fill(x2, inBetween, 'g');
댓글 수: 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!