필터 지우기
필터 지우기

Printing a calculated function.

조회 수: 5 (최근 30일)
Areeb Zahid
Areeb Zahid 2023년 10월 14일
편집: John D'Errico 2023년 10월 14일
Hi, I'm calculating some convolutions and I need to see what function 'z' is, disp(z) only displays the array of values z has, how can I make it print the function it represents?
syms t
t = linspace(-10, 10, 1000)
t1 = linspace(-10, 10, 2000)
x = cos(8*pi*t)
subplot(3, 1, 2)
plot(t, x)
title('x(t)')
y = rectangularPulse(-2.5, 2.5, t)
subplot(3, 1, 1)
plot(t, y)
title('h(t)')
z = conv(x, y, 'same')
subplot(3, 1, 3)
plot(t, z)
title('y(t)')
disp(z) % How do I display the function this represents?

답변 (2개)

Walter Roberson
Walter Roberson 2023년 10월 14일
syms t T
x(t) = cos(8*pi*t)
x(t) = 
y(t) = rectangularPulse(-2.5, 2.5, t)
y(t) = 
z(t) = int(x(t)*y(T-t), T, -inf, inf) %continuous convolution
z(t) = 

John D'Errico
John D'Errico 2023년 10월 14일
편집: John D'Errico 2023년 10월 14일
You CANNOT. At least, given only the vector of values, there are infinitely many possible functions that may have generated them. MATLAB cannot possible know which one caused thatvector of numbers to arise.
Can you compute a convolution using symbolic tools? Well, yes. Sort of. Given function inputs, then the convolution is just an integral. If the integral has an analytical solution, and the symbolic tool int can solve it, then yes. Conv does not accept symbolic input as I recall though.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by