Matlab program of a finite sum that returns the result in a matrix

794 Views Asked by At

I am trying to write a simple program for a finite sum from say 0 to 4 of an equation with two variables , say m' and n. each variable takes values form 0 to 4. The result will be in a matrix form and the matrix element corresponds to values of a and b.

That is element A(1,2) will the finite sum of the equation when m' =1 and n=2.

A(m',n)=sum((d^(-1)exp(2(n^2)*i*2*pi/d))(exp(m^2)*i*2*pi/d) - mn + m'n), m=0:4)