>> x=linspace(-,,);
>> y=x.^.*sin(x);
>> plot(x,y,'linewidth',)
>> plot(x,y,'linewidth',) 分析:
linspace,分割。把(-,)分割成50份,赋值给x
y=x^*sin(x)
画出 x,y在同一坐标系下的图像,线的宽度为2
切片图,可以做多维图
>> x=linspace(-,,);
>> y=x;
>> z=x;
>> [x,y,z]=meshgrid(x,y,z);
>> w=x.^+y.^+z.^;
>> slice(x,y,z,w,[-,,],[-,,],[-,,]);
>> colorbar
plot3函数进行三维做图,quiver3函数进行抖动:
>> t=:0.1:1.5;
>> Vx=*t;
>> Vy=*t.^;
>> Vz=*t.^-t.^;
>> x=t.^;
>> y=(/)*t.^;
>> z=(/)*t.^-(/)*t.^;
>> plot3(x,y,z,'r.-'),hold on
>> Vx=gradient(x);
>> Vy=gradient(y);
>> Vy=gradient(z);
>> quiver3(x,y,z,Vx,Vy,Vz),grid on