如题所述
用plot()绘图函数就可以实现。
>> t=1970:10:2010;
>> x1=[26.4 22.9 19.0 15.0 12.7];
>> x2=[7.3 10.1 14.5 21.5 27.2];
>> plot(t,x1,t,x2),grid on
>> xlabel('t');ylabel('x');
>>legend('0~14岁年龄段','65岁以上年龄段',2)
运行结果