how to make graph for this function
이전 댓글 표시
답변 (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
Eva
2020년 11월 15일
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)

카테고리
도움말 센터 및 File Exchange에서 Mathematics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!