x1 = cos(2*pi*4*t); , x2 = cos(2*pi*12*t), x3 = cos(2*pi*16*t), x4 = cos(2*pi*28*t) Plot the continuous-time waveforms x1(t), x2(t), x3(t) and x4(t) over a 1-second interval
4 views (last 30 days)
Show older comments
t1 % how can i assign my time
x1 = cos(2*pi*4*t1);
x2 = cos(2*pi*12*t1);
x3 = cos(2*pi*16*t1);
x4 = cos(2*pi*28*t1);
subplot(2,2,1); % select the 1st out of 4 subplots
plot(t1,x1); % plot a CT signal x1
grid on; % turn on the grid
xlabel('time (t)'); % Label the x-axis as time
ylabel('cos(2*pi*4*t)');% Label the y-axis
title('Graph of x1'); % Insert the title
subplot(2,2,2); % select the 2nd out of 4 subplots
plot(t1,x2); % plot a CT signal x2
grid on; % turn on the grid
xlabel('time (t)'); % Label the x-axis as time
ylabel('cos(2*pi*12*t)');% Label the y-axis
title('Graph of x2'); % Insert the title
subplot(2,2,3); % select the 3rd out of 4 subplots
plot(t1,x2); % plot a CT signal x3
grid on; % turn on the grid
xlabel('time (t)'); % Label the x-axis as time
ylabel('cos(2*pi*16*t)');% Label the y-axis
title('Graph of x3'); % Insert the title
subplot(2,2,4); % select the 4th out of 4 subplots
plot(t1,x2); % plot a CT signal x3
grid on; % turn on the grid
xlabel('time (t)'); % Label the x-axis as time
ylabel('cos(2*pi*28*t)');% Label the y-axis
title('Graph of x4'); % Insert the title
0 Comments
Answers (1)
Voss
on 31 Jan 2023
t1 = linspace(start_time,end_time,number_of_samples)
For example, to use 100 samples over a one-second interval starting at t = 0:
t1 = linspace(0,1,100);
Then the rest can be like you have it already:
x1 = cos(2*pi*4*t1);
x2 = cos(2*pi*12*t1);
x3 = cos(2*pi*16*t1);
x4 = cos(2*pi*28*t1);
subplot(2,2,1); % select the 1st out of 4 subplots
plot(t1,x1); % plot a CT signal x1
grid on; % turn on the grid
xlabel('time (t)'); % Label the x-axis as time
ylabel('cos(2*pi*4*t)');% Label the y-axis
title('Graph of x1'); % Insert the title
subplot(2,2,2); % select the 2nd out of 4 subplots
plot(t1,x2); % plot a CT signal x2
grid on; % turn on the grid
xlabel('time (t)'); % Label the x-axis as time
ylabel('cos(2*pi*12*t)');% Label the y-axis
title('Graph of x2'); % Insert the title
subplot(2,2,3); % select the 3rd out of 4 subplots
plot(t1,x2); % plot a CT signal x3
grid on; % turn on the grid
xlabel('time (t)'); % Label the x-axis as time
ylabel('cos(2*pi*16*t)');% Label the y-axis
title('Graph of x3'); % Insert the title
subplot(2,2,4); % select the 4th out of 4 subplots
plot(t1,x2); % plot a CT signal x3
grid on; % turn on the grid
xlabel('time (t)'); % Label the x-axis as time
ylabel('cos(2*pi*28*t)');% Label the y-axis
title('Graph of x4'); % Insert the title
0 Comments
See Also
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!