title: Resizing an Image in MATLAB
body: <p>I'm trying to create a function the scales an image based on a value (scale_zoom) for a homework assignment. I don't want to use the MATLAB built in function <code>resize()</code> in this function so I'm trying to interpolate. Any help would be greatly appreciated. This is what I have so far:</p>
  
  <pre><code>function pic_new=scale_image(pic,scale_zoom)
      [row, col]=size(pic)
      ht_scale=size(pic,1)/scale_zoom*col
      wid_scale=size(pic,2)/scale_zoom*row
  
      size(ht_scale)
      size(wid_scale)
      x=(0:scale_zoom)*wid_scale
      y=(0:scale_zoom)*ht_scale
      length(x)
      length(y)
      %plotvals=0:0.1:scale_zoom (this is not necessary i think)
      newimg=interp1(pic,x,y,'cubic')
      image(newimg)
  end
  </code></pre>
  
  <p>I think I'm interpolating it very incorrectly :/</p>