フィルターのクリア

Why do I receive 'Error using sym>tomupad' in Line 6 when plotting impulse signal with right time shifting?

1 回表示 (過去 30 日間)
%create symbolic functions x, a, b, c, d, e, f_c with independent variable t
syms x(t) a(t) h(t) b(t) c(t) d(t) e(t) f_c(t)
x(t) = cos(100*pi*t);
a(t) = x(0.4*t);
h(t) = stem([0]+0.02,[1]);
%plot signal x(t)
figure
fplot(x(t))
xlim([-0.5 0.5]),ylim([-2 2])
title ('Time domain of signal x(t)')
xlabel('Time, t')
ylabel('Amplitude, x(t)')
grid on
%plot signal h(t)
figure
fplot(h(t))
xlim([-0.5 0.5]),ylim([-2 2])
title ('Time domain of signal h(t)')
xlabel('Time, t')
ylabel('Amplitude, h(t)')
grid on
  1 件のコメント
TEOH CHEE JIN
TEOH CHEE JIN 2022 年 12 月 5 日
When writting in mathematical expression, h(t) = 𝛿(t-0.02). I expect the impulse signal to shift right by 0.02 seconds after plotting it.

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

採用された回答

VBBV
VBBV 2022 年 12 月 5 日
%create symbolic functions x, a, b, c, d, e, f_c with independent variable t
syms x(t) a(t) h(t) b(t) c(t) d(t) e(t) f_c(t)
x(t) = cos(100*pi*t);
a(t) = x(0.4*t);
h = stem([0]+0.02,[1])
h =
Stem with properties: Color: [0 0.4470 0.7410] LineStyle: '-' LineWidth: 0.5000 Marker: 'o' MarkerSize: 6 MarkerFaceColor: 'none' BaseValue: 0 XData: 0.0200 YData: 1 Show all properties
%plot signal x(t)
figure
fplot(x(t))
xlim([-0.5 0.5]),ylim([-2 2])
title ('Time domain of signal x(t)')
xlabel('Time, t')
ylabel('Amplitude, x(t)')
grid on
%plot signal h(t)
% figure
% plot(h.XData,h.YData)
% % xlim([-0.5 0.5]),ylim([-2 2])
% title ('Time domain of signal h(t)')
% xlabel('Time, t')
% ylabel('Amplitude, h(t)')
% grid on
  1 件のコメント
VBBV
VBBV 2022 年 12 月 5 日
編集済み: VBBV 2022 年 12 月 5 日
h = stem([0]+0.02,[1]) % stem returns the function handle structure
You are trying to plot function handle using fplot. instead access XData , YData from function handle and plot

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by