# MATLAB: How to do a summation of a signal.

summation

 if i have a signal y = Acos(wt) and now i want to vary my amplituded and angular frequency. like that-  ∑A(i)cos(w(i)t) where i varies from any 1 to 100.I write the code like thist = 0:0.01:1;A(1:length(t)) = 0;w(1:length(t)) = 0;
t = 0:0.01:1;A(1:length(t)) = 0;w(1:length(t)) = 0;y = 0;for i = 1:length(t)   y = y + A(i)*cos(w(i)*t(i)) end