% x is an array and t is also an array of same size
f_up = 100;
f = (-f_up:0.02:f_up);
h = 2*pi*f;
for i = 1:length(h)
B(i) = trapz(t, x.*exp(-j.*w.*t));
end

 採用された回答

VBBV
VBBV 2021 年 11 月 7 日

1 投票

% x is the 1*476 array and t is also a 1*476 array meaning time
f_up = 100;
x= rand(1,476);
t = x;
f = (-f_up:0.1:f_up);
w = 2*pi*f;
for i = 1:length(w)
Xjw(:,i) = trapz(t, x.*exp(-j.*w(i).*t));
end
plot(Xjw)

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeElementary Math についてさらに検索

タグ

質問済み:

2021 年 11 月 7 日

編集済み:

2021 年 11 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by