# MATLAB: How to vectorize sum of scaled matrices ? Or is there matlab function for irregular inverse dft

fftmatrixndftvectorization

I am trying to inverse transform function on irregular grid. Is there matlab function for irregular inverse dft ?
I would like simplify a code with sum of repeating matrix M multiplied and to the power of vector elements:
X = ones(10,10) % just for simplicity matrixY = rand(10,10) % another matrixM1 = exp(1i*X);M2 = exp(1i*Y);v1 = [1, 2, 3, 13, 14]; % some vectorv2 = [10, 20, 13, 33, 44]; % some vector same lengthf = [3, 5, 7, 9, 11]; % another vector same lengthA = zeros(10,10); %initialize the sumfor ii = 1: length(v)S = f(ii)*(exp(1i*(Y*v1(ii) + X*v2(ii))));A = S +A;endA
Could repmat or some other function create vectorized version of the code to get the sum?

• A = reshape(exp(1i*[X(:),Y(:)]*[v2;v1])*f(:),size(X));