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);

采纳的回答

Walter Roberson
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)
Z = 
% Compute the convolution in the time domain
signal_in_time = ifourier(Z)
signal_in_time = 
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)
Z2 = 
signal_in_time2 = ilaplace(Z2)
signal_in_time2 = 
fplot(signal_in_time2)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by