Matlab小问题。急

来源:百度知道 编辑:UC知道 时间:2024/06/05 10:38:02
1.用subplot()函数在同一图画出y 和semilogx semlogy 图,y 的变化为
[0 0.6 2.3 5 8.3 11.7 15 17.7 19.4 20]。
2。 以上题中的y作为矢量,创建条形图。
3.z=xe^(-x^2-y^2),当x和y的取值范围均为-2到2时,用建立子窗口的方法在同一图开窗口中绘制出三维线图、网线图和表面图
计算多项式3x^2+2x+1微分和积分

figure(1);
y=[0 0.6 2.3 5 8.3 11.7 15 17.7 19.4 20];
subplot(2,2,1);plot(y);
semilogx(y);subplot(2,2,2);plot(y);
semilogy(y);subplot(2,2,3);plot(y);
figure(2)
bar(y);
figure(3);
x=[-2:2];y=[-2:2];
z=x.*exp(-x.^2-y.^2);
subplot(2,2,1);
z=x.*exp(-x.^2-y.^2);
plot3(x,y,z);
subplot(2,2,2);
z1=3*cplxgrid(20);%在复平面上面得到一个21*41的网格,x,y分别为其实部和虚部
x=real(z1);
y=imag(z1);
z = x.*exp(-x.^2-y.^2);
mesh(x,y,z);
subplot(2,2,3);
x=[-2:2];y=[-2:2];[X,Y]=meshgrid(x,y);
Z = X.*exp(-X.^2-X.^2);
surf(X,Y,Z);

1:
>> z = x.*w;
>> plot3(x, y, z);
>> y = [0 0.6 2.3 5 8.3 11.7 15 17.7 19.4 20];
>> subplot(311);
>> plot(y);
>> subplot(312);
>> semilogx(y);
>> subplot(313);
>> semilogy(y);
>>
2:
>>bar(y);
3:
三维线图:
>> x = -2:2;
>> y = -2:2;