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

5 ビュー (過去 30 日間)
HIWOT
HIWOT 2023 年 1 月 31 日
編集済み: Voss 2023 年 1 月 31 日
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

回答 (1 件)

Voss
Voss 2023 年 1 月 31 日
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

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by