【发布时间】:2014-11-13 21:07:47
【问题描述】:
我正在尝试在图表中绘制 cos(x) 和 sin(x)。 这是我的代码:
t = -pi:0.01:(pi);
x = cos(t);
y = sin(t);
plot(t,x,'b'); hold on;
plot(t,y,'r');
axis([-pi pi -1 1])
legend('cos(t)','sin(t)','Location','NorthWest')
title('Plot of cos(x) and sin(x) between -2\pi and 2\pi')
我想改变 y 轴上的数字,这样我就只有 -pi, -pi/2, 0 ,pi pi 有什么帮助吗?
【问题讨论】: