Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function foo (x, arr, T)
- n = length(arr);
- y = zeros(1, length(x)) + arr(1) / 2;
- t = 1;
- for k = [2:n]
- t /= 2;
- y += arr(k) * t * cos(2 * pi * k * x / T);
- end
- figure();
- plot(x, y);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement