title: use dft for image processing in matlab with out matlab function
body: <p>I have 2 function in matlab</p>
  
  <pre><code>%%%%%%% test_dft 
  clc;clear all;close all;
  %%
  
  
    img=(imread('images/test_image.jpg'));
  if isrgb(img)
      a=double(rgb2gray(img));
  else
      a=double(img);
  end
  temp = zeros(size(a));
  f = double(zeros(size(a)));
  [m n]=size(a)
  for i = 1:m
      temp(:,i)=dft(a(:,i));
   end
  for j = 1:n
     f(j,:) = dft(a(j,:));
  end
  
  
  %%%%%%%% dft.m
  function X=dft(x1) 
  N=length(x1);
  X=zeros(size(x1)); 
  i=sqrt(-1); 
  for k=0:N-1 
  for n=0:N-1 
  X(k+1)=(X(k+1)+x1(n+1)*exp(-2*pi*i*k*n/N)) ;
  end 
  end
  end
  </code></pre>
  
  <p>I wanna calculate dft of image and after that use it for masking in frequency domain( with out matlab function ).
  this code tacks long time, but it doesn't work. I don't know why .</p>