how to make graph for this function
1 次查看(过去 30 天)
显示 更早的评论
回答(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)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/414888/image.jpeg)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Directed Graphs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!