I am new in Matlab and I am trying to plot this function in Matlab:
I am using the following code:
t = -2*pi:0.01:2*pi;
f = sum(cos(2*pi*i*t), i = 1 .. 10);
plot(t, f)
But I getting this message error:
f = sum(cos(2*pi*i*t), i = 1 .. 10);
|
Error: The expression to the left of the equals sign is not a valid target for an assignment.
Can anyone help me?
EDIT: I am using Matlab 2013a
tis 1x1257 and1:10is 1x10,1:10*twill not work. @marcelof = sum(cos(2*pi*i*t), i = 1 .. 10);is not Matlab syntax. Read the documentation forsum: mathworks.com.au/help/matlab/ref/sum.html. - David