1、二维函数的绘制
1.1简单函数
>> x = 0:0.1:10;
>> y = sin(x);
>> plot(x,y);
>> grid on
1.2分段函数的绘制
>> x = [-2:0.02:2];
>> y = 1.1*sign(x).*(abs(x) > 1.1) + x.*(abs(x)<=1.1);
>> plot(x, y);
注:在非线性强烈的地方一定需要多去几个点
3、特殊二维函数
>> t = 0:0.1:4*pi;
>> r = sin(8*t/3)./(2-cos(3*t/2).^2);
>> polar(t,r);
>> t = 0:0.01:6*pi;
>> r = sin(8*t/3)./(2-cos(3*t/2).^2);
>> polar(t,r);
4、多个二维函数
>> subplot(2,2,1),stairs(t,y)
>> subplot(2,2,2),stem(t,y)
>> subplot(2,2,3),bar(t,y)
>> subplot(2,2,4),semilogx(t,y)
5、隐函数的绘图
>> ezplot('x*y*sin(x^2+y^2)+(x+y)^2*exp(-(x+y))')
6、三维函数的绘制
具体和二维函数一样,只不过函数变化了,参数增加了。
>> t = 0:.1:2*pi;
>> x = t.^3.*sin(3*t).*exp(-t);y = t.^3.*cos(3*t).*exp(-t);
>> z = t.^2;
>> plot3(x,y,z)
2021.9.14
不定时更新