フィルターのクリア

plot a complex sinusoidal function consisting of the sum of 5 sine waves with equal amplitudes

4 ビュー (過去 30 日間)

Compute and plot a complex sinusoidal function consisting of the sum of 5 sine waves with equal amplitudes but whose frequencies are 1,3,5,10, and 20, again for t varying from 0 to 2π.

  3 件のコメント
Sahil Kolambkar
Sahil Kolambkar 2022 年 4 月 22 日
Im not able to sum the sine waves.

サインインしてコメントする。

採用された回答

Prasanna Konyala
Prasanna Konyala 2022 年 4 月 27 日
Hi Sahil
From my understanding, you want to plot the sum of all 5 sinewaves with different frequencies.
Considering amplitude as 1, 100 time samples between 1 and 2*pi. Please go through the below code for a workaround.
[t,totalSum] = s_wave();
plot(t,totalSum);
% function to compute the sum
function [t,totalSum] = s_wave()
% 100 values between 1 and 2*pi
t = linspace(0, 2*pi);
totalSum=zeros(100);
frequency=[1,3,5,10,20];
for index = 1 : length(t)
time = t(index);
sineValues= sin(frequency*time);
totalSum(index) = sum(sineValues);
end
end
Hope this helps.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by