I'm trying to record values of cn during a for loop, but I can't seem to index into a vector x using the value for the iteration, because my for loop is running from values -50:50. So It cant index into x at x(1,n). I have no idea how to solve this. Does anyone have any suggestions? Thank you!
x = zeros(1,length(-nmax : 1 : nmax));
for n = -nmax : 1 : nmax;
cn = (A/ (T*-1i*n*wo) ) * (exp(-1i*n*wo*T/2)-1);