matlab画图命令笔记

时间:2021-11-25 01:57:45

1 函数画图fplot

% Create a function plot of y = x^3 over the domain of [-2 2].
% Plot with a thick red line.
fplot(@(x) x.^3, [-2 2], 'r', 'LineWidth',2)
% Add labels and title
xlabel('x')
ylabel('y')
title('y = x^3')

参考网站:

https://ww2.mathworks.cn/matlabcentral/profile/authors/3166380-mathworks-plot-gallery-team

https://ww2.mathworks.cn/matlabcentral/fileexchange/?term=authorid:196102