Azzera filtri
Azzera filtri

The following error was reported evaluating the function in FunctionLine update: Unable to convert expression containing remaining symbolic function calls into double array

2 visualizzazioni (ultimi 30 giorni)
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);

Risposta accettata

Walter Roberson
Walter Roberson il 20 Ott 2023
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)

Più risposte (0)

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by