I am also confused about what is the question actually. I guess you want to plot that formula.
Have a row vector k = 0:(n/2 - 1)
(suppose n
even).
Then you need your d
coefficients as a row vector of the same length. (I don't know from where you get them though)
Then define your column vector x
(column vector is made from a row vector by transposing, eg x = x.'
)
Left term of the function is then
leftterm = sum(d .* exp(i * x * k), 2)
Right term:
rightterm = sum( fliplr(d) .* exp(- i * x * (k.+1)), 2)
Alltogether they give:
f = sum(d .* exp(i * x * k) + fliplr(d) .* exp(- i * x * (k .+ 1)), 2)
and you plot it with:
plot(x,f)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.