Error using sym/subsindex when doing convolution of two signals (cosine function and impulse function) in MATLAB.
Show older comments
%create symbolic functions x, a, b, c, d, e, f_c with independent variable t
syms x a h b c d e f_c t tau
x(t) = cos(100*pi*t);
a(t) = x(0.4*t);
%plot signal a(t)
figure
fplot(a)
xlim([-0.5 0.5]),ylim([-2 2])
title ('Time domain of signal a(t)')
xlabel('Time, t')
ylabel('Amplitude, a(t)')
grid on
%plot signal h(t)
figure
h = stem([0]+0.02,[1]);
%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
fplot(int(a(tau)*h(t-tau), 'tau', -inf, inf))
xlim([-1 1]),ylim([-5 5])
title ('Time domain of signal a(t)')
xlabel('Time, t')
ylabel('Amplitude, b(t)')
grid on
% In Line 26, it shows an error where it mentioned Invalid indexing or function definition. I would like to integrate the signal by switching t to tau domain to solve the convolution and the code is written above.
Accepted Answer
More Answers (0)
Categories
Find more on Descriptive Statistics 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!
