how to plot a continuous signal

49 ビュー (過去 30 日間)
Mohammadreza kalantari
Mohammadreza kalantari 2019 年 10 月 19 日
回答済み: Asif 2024 年 4 月 4 日
I want to plot x(t) = cos(200*pi*t*u(t)) and define u(t) seprately and then plot x(-t),x(t/3)
i wrote this
x = @(t) cos(200*pi*t*u(t));
t = linspace(-1, 1);
figure(1)
plot(t, x(t))
grid
function y = u(x)
y=0;
if x>=0
y=1;
end
end

採用された回答

Star Strider
Star Strider 2019 年 10 月 19 日
This should get you started:
u = @(t) t>=0;
x = @(t,u) cos(200*pi*t.*u(t));
t = linspace(-1, 1);
figure(1)
plot(t, x(t,u))
grid
Extending that:
u = @(t) t>=0;
x = @(t,u) cos(200*pi*t.*u(t));
t = linspace(-1, 1);
figure(1)
plot(t, x(t,u))
hold on
plot(t, x(-t,u))
plot(t, x(t/3,u))
hold off
grid
Experiment to get different results.
  8 件のコメント
Mohammadreza kalantari
Mohammadreza kalantari 2019 年 10 月 31 日
編集済み: Mohammadreza kalantari 2019 年 10 月 31 日
I asked in that way too.
Star Strider
Star Strider 2019 年 10 月 31 日
I will delete this Comment in a few minutes, then.

サインインしてコメントする。

その他の回答 (1 件)

Asif
Asif 2024 年 4 月 4 日
t=0:0.01:5; %Time from 0 to 5 seconds with a step size of 0.01 seconds
%Define the continous signal ( for example, a sinusoidal signal)
% Frequency=2; %Frequency of the sinusoid in HZ
Amplitude=1; % Amplitude of the sinusoid
Phase = pi/4; %phase of the sinusoid ( in radians)
signal = Amplitude*sin(2*pi*Frequency*t+Phase);
% plot the continuous signal
plot(t, signal,'b','Linewidth',6);
xlabel('xTime(s)X');
ylabel('Ampltitude');
title('Continuous Sinusoidal signal');
grid on

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by