title: How to apply affine transform so that it works well with all transforms including translation?
body: <p>For some reason <code>imtransform</code> function ignores translation part by default.</p>
  
  <p>If I add additional space with <code>XData</code> and <code>YData</code> as it said in manual, I will handle only simple cases (i.e. translation only).</p>
  
  <p>So, how to apply full-featured affine transform in Matlab?</p>
  
  <pre><code>I = imread('cameraman.png');
  imshow(I);
  
  % does not translate
  xform = [1 2 0; 2 1 0; 100 0 1];
  T = maketform('affine',xform);
  I2 = imtransform(I,T);
  figure, imshow(I2)
  
  
  % translates but cuts some portion of an image
  xform = [1 2 0; 2 1 0; 100 0 1];
  T = maketform('affine',xform);
  I2 = imtransform(I,T,'XData',[1 size(I,2)+xform(3,1)],'YData',[1 size(I,1)+xform(3,2)]);
  figure, imshow(I2)
  </code></pre>