1 plot()函数
画一条线
plot(X,Y)
最基本的例子
x = 0: pi / 100:2 * pi;y = sin(x);figureplot(x,y)在一张图上画多条线
clc;clear;x = linspace(-2 * pi,2 * pi);y1 = sin(x);y2 = cos(x);figureplot(x,y1,x,y2)
2 Matlab绘制两个图
Matlab可以使用figure(1), figure(2)作多幅图
clc;clear;buoy_effective_wave = [1.451.431.411.421.3821.3641.39];radar_effective_wave = [1.448461.386541.10791.680660.99181.293661.62648];figure(1);x = 0 : 6;plot(x,buoy_effective_wave,'g--',x,radar_effective_wave,'r:');title('有效波');grid on;buoy_wave_crest_week=[36.6936.2137.3236.7936.77336.09137.03];radar_wave_crest_week=[35.83346.538.736.630.239.5];figure(2);x = 0 : 6;plot(x,buoy_wave_crest_week,'g--',x,radar_wave_crest_week,'r:');title('波峰周');grid on;buoy_wave_crest=[111.268110.972112.153112.484110.495112.951117.189];radar_wave_crest=[88.4868.35102.1685.1690.62103.4991.32];figure(3);x = 0 : 6;plot(x,buoy_wave_crest,'g--',x,radar_wave_crest,'r:');title('波峰峰');grid on;
参考资料:
1