x = [1,2,3];
y = [4,5,6];
plot(x,y);
x = -3:3;
y = x.*x;
plot(x,y);
图像会有点方,matlab画图导致的
解决方案,多增加点
x = -3:0.001:3;
y = x.*x;
plot(x,y);
圈出关键点
x = -3:0.1:3;
y1 = x.^2;
y2 = x.^3;
plot(x,y1,'green-o');
横纵轴单位长度一样
axis equal
直方图
y = [75 91 105 123.5 131 150 179 203 226 281];
x = 2000:2009;
bar(x,y)
theta = 0:pi/50:6*pi;
x = cos(theta);
y = sin(theta);
z = 0:300;
plot3(x,y,z)