MATLAB: Plotting multi-component signals

plotting

I'm trying to plot a multi-component signal composed of the following segments in the following order:
epoch1 = 0.5*cos(pi*t) + 1.5*cos(4*pi*t) + 4*cos(5*pi*t);
epoch2 = 0.7*cos(pi*t) + 2.1*cos(4*pi*t) + 5.6*cos(5*pi*t);
epoch3 = 1.5*cos(2*pi*t) + 4*cos(8*pi*t);
epoch4 = 1.5*cos(pi*t) + 4*cos(4*pi*t);
epoch5 = 0.5*cos(pi*t) + 1.7*cos(2*pi*t) + 3.7*cos(5*pi*t);
epoch6 = 2.3*cos(3*pi*t) + 7.8*cos(8*pi*t);
epoch7 = 0.8*cos(pi*t) + cos(3*pi*t) + 3*cos(5*pi*t);
It should look like this:
I tried this:
t = [0:0.0001:50];
epoch1 = 0.5*cos(pi*t) + 1.5*cos(4*pi*t) + 4*cos(5*pi*t);
epoch2 = 0.7*cos(pi*t) + 2.1*cos(4*pi*t) + 5.6*cos(5*pi*t);
epoch3 = 1.5*cos(2*pi*t) + 4*cos(8*pi*t);
epoch4 = 1.5*cos(pi*t) + 4*cos(4*pi*t);
epoch5 = 0.5*cos(pi*t) + 1.7*cos(2*pi*t) + 3.7*cos(5*pi*t);
epoch6 = 2.3*cos(3*pi*t) + 7.8*cos(8*pi*t);
epoch7 = 0.8*cos(pi*t) + cos(3*pi*t) + 3*cos(5*pi*t);
figure;
hold
plot(t, epoch1);
plot(t, epoch2);
plot(t, epoch3);
plot(t, epoch4);
plot(t, epoch5);
plot(t, epoch6);
plot(t, epoch7);
The paper I'm reading says that it's using 50 synthetic multi-component data, which makes me think that it is sampling data points from these functions and then plotting the data points, but I'm not sure how to do that. Any help on how to to do this is appreciated.

Best Answer

t = [1:0.1:7];
epoch1 = 0.5*cos(pi*t) + 1.5*cos(4*pi*t) + 4*cos(5*pi*t);
epoch2 = 0.7*cos(pi*t) + 2.1*cos(4*pi*t) + 5.6*cos(5*pi*t);
epoch3 = 1.5*cos(2*pi*t) + 4*cos(8*pi*t);
epoch4 = 1.5*cos(pi*t) + 4*cos(4*pi*t);
epoch5 = 0.5*cos(pi*t) + 1.7*cos(2*pi*t) + 3.7*cos(5*pi*t);
epoch6 = 2.3*cos(3*pi*t) + 7.8*cos(8*pi*t);
epoch7 = 0.8*cos(pi*t) + cos(3*pi*t) + 3*cos(5*pi*t);
y=[epoch1 epoch2 epoch3 epoch4 epoch5 epoch6 epoch7];
figure;
plot([1:length(y)]*0.1,y)
Hope this solves your query. MATLABhelper.com