필터 지우기
필터 지우기

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 CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by