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!