用matlab画图 要详细步骤和过程!!!
这两道题都不是很复杂,根据要求弄就完事了。
具体程序如下:
clear all
close all
%%
theta = 0:pi/100:2*pi;
R = 3;
x = R*cos(theta);
y = R*sin(theta);
figure
plot(x,y,'b-.','LineWidth',2)
grid on
hold on
x1 = 0:pi/100:4*pi;
y1 = exp(-x1./4).*sin(4*x1);
plot(x1,y1,'g:','LineWidth',2)
title('题目1')
xlabel('x')
ylabel('y')
axis equal
%%
x = -4:0.01:4;
y = x.^2.*cos(x);
figure
plot(x,y,'b-.','LineWidth',2)
grid on
hold on
x1 = 3:0.01:10;
y1 = 2*exp(1./(x1.^2)).*sin(x1);
plot(x1,y1,'r','LineWidth',2)
title('题目2')
xlabel('x')
ylabel('y')
axis equal
legend('y = x^2cosx','y = 2e^(^1^/^x^2^)sinx')
结果如图: