matlab参数方程画曲线
求x2 - 3x +1 = 0
x = -5:0.1:5;
y1 = x.x-3x+1;
y2=zeros(size(x));
plot(x,y1,x,y2);
f = @(x) xx-3x+1
x1=fzero(f,0.5)
x2 = fzero(f,2.5)
x = [0.2,1.8,2.5]
y = [1.3,2.8,1.1]
z = [0.4,1.2,1.6]
plot3(x,y,z)
grid on
axis([0,3,1,3,0,2])
t = linspace(0,10*pi,200) %生成有200个元素的向量t
x = sin(t) + t.*cos(t)
y = cos(t)-t.*sin(t)
z = t
subplot(1,2,1)
plot3(x,y,z)
grid on
subplot(1,2,2)
plot3(x(1:4:200),y(1:4:200),z(1:4:200))
grid on
plot(cos(0:pi/20:2*pi))
O表示圆 r表示红色
t = linspace(1,2)
f = t.t
g = sin(2pi.*t)
plot(t,f,‘b’,t,g,‘or’)
xlabel(‘Time (ms)’)
ylabel(‘f(t)’)
title(‘Mini Assignment #1’)
legend(‘t^{2}’,‘sin(2\pi t)’)
赞 (0)