plot a complex sinusoidal function consisting of the sum of 5 sine waves with equal amplitudes
5 views (last 30 days)
Prasanna Konyala on 27 Apr 2022
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();
% function to compute the sum
function [t,totalSum] = s_wave()
% 100 values between 1 and 2*pi
t = linspace(0, 2*pi);
for index = 1 : length(t)
time = t(index);
totalSum(index) = sum(sineValues);
Hope this helps.