I understand that you are trying to get the eigen functions (v,w) after substituting the Fourier coefficients into Fourier expansion and are not comfortable coding in MATLAB as a new user.
Follow the steps below to code an equation in MATLAB :
1. Be thorough with the sizes of Matrices/Vectors.
Here, "A" is a vector of size (513 by 1).
"B" is a vector of size (513 by 1).
"x" is a vector of size (1 by 1024).
x = [x1, x2, x3,.... x1024] and v(x) = [v(x1), v(x2), v(x3),.... v(x1024)] and v(x1), v(x2)... v(x1024) are all scalars as they are summation for given value x. Hence the size of "v" will be the same size as "x".
Similarly size of "w" is same as size of "x".
2. Expand equations to Identify Patterns.
According to the given equation for "v(x)", you can expand it for various values of x as shown :
3. Extract matrices from patterns.
Try to express the equations in Matrix form. "n*x" is the variable here. So, all the equations can be written in the matrix form as :
Note that exponential on a matrix is equivalent to exponential on individual element of the matrix in MATLAB.
4. Code Matrices and the Equation
"A" is already available as a Matrix. The only need is to code "Variables matrix".
Repeated_N_Matrix = repmat(n,L,1);
Repeated_X_Matrix = repmat(X',1,2*N+1);
Variables_Matrix = Repeated_N_Matrix .* Repeated_X_Matrix;
v = exp(1i*Ko*Variables_Matrix)*A;
v = exp( 1i*Ko* ( repmat(n,L,1) .* repmat(X',1,2*N+1) ) ) * A;
Similarly, by using the same approach "w(x)" can be found as well.