Exercise 1.8
%% Task 1
>> t=(0:0.1:10)
%% Task 2
>> y1=sin(2*t)
>> y2=2*cos(3*t)
>> y3=tan(t)
%% Task 3
>> plot(t,y1,’-k’)
>> hold on
>> plot(t,y2,’--r')
>> plot(t,y3,’-.m’)
>> hold off
>> ylim([-5 5])
%% Task 4
>> legend(‘y1’,’y2’,’y3’)
>> xlabel('Time (s)')
%% Task 5
>> subplot(3,1,1)
>> plot(t,y1,’-k’)
>> xlim([1 9])
>> xlabel('Time (s)')
>> subplot(3,1,2)
>> plot (t, y2,‘--r')
>> xlim([1 9])
>> xlabel('Time (s)')
>> subplot(3,1,3)
>> plot(t,y3,’-.m’)
>> xlim([1 9])
>> xlabel('Time (s)')