I am trying to obtain a plot where I would like to represent a cosine function made from different time vectors. Here is the code I am using in order to make myself clear:
fs = 1;
f1 = 1;
f2 = 2;
time2 = (20:0.1:40);
cos1 = cos(2*pi*f1*time1);
cos2 = cos(2*pi*f2*time2);
Now, I do not know how to obtain a single continuous cosine in a plot. Normally, cos2 should begin where cos1 end. If I plot cos1 and cos2 on the same graph I will obtain 2 overlaped shifted cosines.
How can I make a plot where cos2 is 'glued' to cos1 obtaining a single cosine function which has two different frequencies and also assuring the continuation of time?
Any advice will be very appreciated.