title: How would you pixelate an image in Matlab without using the image toolbox?
body: <pre><code>mypicture=imread(filename); %inputs 1st image
  [row col pan]=size(mypicture);
  subplot(2,1,2)
  pixpicture=mypicture;
  image(pixpicture);
  hold on;
  
  for J=1:stepval:row
  for K=1:stepval:col
      pix=pixpicture(J,K,:);
      x=[K K+stepval K K+stepval];
      y=[J J J+stepval J+stepval];
      plot(x,y);
      hold all;
  end    
  end
  
  subplot (2,1,1)
  image(mypicture);
  end
  </code></pre>
  
  <p>I'm trying to pixelate an image without using the image processing toolbox. I was told the method, which is to take a pixel then color all of the surrounding pixels that color, however I'm having trouble doing this in my code. What I have above is what I've tried however it doesn't quite work as intended.</p>
  
  <p>What are your suggestions?</p>