1.
plot(peaks);
set(findobj('Type','line'),'Color','b'); % 把所以线条的颜色设置为蓝色
2.
y=heaviside(t); % 阶跃函数 y=u(t)
3.
(1)f=f(x) ezplot(f):
在默认区间-2π<x<2π绘制f = f(x)的图形。ezplot(f, [a,b]):在区间a<x<b绘制f = f(x)的图形。(2)f=f(x,y) ezplot(f):在默认区间-2π<x<2π和-2π<y<2π绘制f(x,y) = 0的图形。ezplot(f, [xmin,xmax,ymin,ymax]):在区间xmin<x<xmax和ymin<y<ymax绘制f(x,y) = 0的图形。ezplot(f, [a,b]):在区间a<x<b和a<y< b绘制f(x,y) = 0的图形。(3)对于参数方程x = x(t)和y = y(t),ezplot函数的调用格式为: ezplot(x,y):在默认区间0<t<2π绘制x=x(t)和y=y(t)的图形。ezplot(x,y, [tmin,tmax]):在区间tmin < t < tmax绘制x=x(t)和y=y(t)的图形。
ezplot('x^2 + 1')
ezplot('x^2 + 1',[-5,5])
4. line()
line([5,8],[0,3]); % 画一条线,从点(5,0)到点(8,3) line([5,8],[0,0],'color',[0,0,1]); % 颜色为蓝色