The following error was reported evaluating the function in FunctionLine update: Unable to convert expression containing remaining symbolic function calls into double array
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello,
I am trying to plot a signal using the fourier function.I dont know how to solve it or if i do something wrong.This is my code:
syms t w;
% Define the first signal u(t)-u(t-2) using the heaviside function
x1 = heaviside(t) - heaviside(t-2);
% Define the second signal u(t)-u(t-4)
x2 = heaviside(t) - heaviside(t-4);
%Multiply the signals
Z = fourier(x1) .* fourier(x2);
% Compute the convolution in the time domain
signal_in_time = ifourier(Z);
%display the graph:
figure(1);
fplot(signal_in_time);
댓글 수: 0
채택된 답변
Walter Roberson
2023년 10월 20일
syms t w;
% Define the first signal u(t)-u(t-2) using the heaviside function
x1 = heaviside(t) - heaviside(t-2);
% Define the second signal u(t)-u(t-4)
x2 = heaviside(t) - heaviside(t-4);
%Multiply the signals
Z = fourier(x1) .* fourier(x2)
% Compute the convolution in the time domain
signal_in_time = ifourier(Z)
Notice that this has unresolved fourier() calls -- places that the inverse fourier has trouble handling.
What can you do? Well you can use the laplace transform instead.
Z2 = laplace(x1) .* laplace(x2)
signal_in_time2 = ilaplace(Z2)
fplot(signal_in_time2)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Measurements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!