how to make graph for this function
조회 수: 2 (최근 30일)
이전 댓글 표시
f:y=Ix−4I+Ix2−5x+6I−Ix+4I+4.
댓글 수: 0
답변 (1개)
Setsuna Yuuki.
2020년 11월 15일
편집: Setsuna Yuuki.
2020년 11월 15일
You can use fplot()
for example:
syms x;
y = @(x) abs(x-4)+abs(x^2-5*x+6)-abs(x+4)+4;
fplot(y,'LineWidth',3);
xlim([-6 12])
more info: https://es.mathworks.com/help/matlab/ref/fplot.html
댓글 수: 2
Setsuna Yuuki.
2020년 11월 15일
편집: Setsuna Yuuki.
2020년 11월 15일
Another way:
x = linspace(-6,12,2000);
y = abs(x-4)+abs(x.^2-5*x+6)-abs(x+4)+4;
plot(x,y,'LineWidth',2)

참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!