title: How to adjust the initial step of fminunc?
body: <p>I have two images that I need to match by transforming one to the other through translation and rotation. For this I have a function like this:</p>
  
  <pre><code>function [differences] = cost_function(transformation)
  
  disp(transformation);
  
  offset_x = transformation(1); % one of the images will be shifted by these many
  offset_y = transformation(2); % pixels in either direction
  angle    = transformation(3); % and rotated by this much
  
  % snip:
  %   * transform the second image
  %   * otsu treshold both
  %   * xor the results
  %   * count pixels that xored
  </code></pre>
  
  <p>Then I try to find its minimum!</p>
  
  <pre><code>best_transform = fminunc(@cost_function, [0 0 0]);
  </code></pre>
  
  <p>However, the solver log shows a very big problem:</p>
  
  <pre><code>  1.0e-007 *
      0.1490         0         0
    1.0e-007 *
           0    0.1490         0
    1.0e-007 *
           0         0    0.1490
           0         0         1
      0.0000         0    1.0000
           0    0.0000    1.0000
           0         0    1.0000
           0         0    0.3333
      0.0000         0    0.3333
  </code></pre>
  
  <p>The solver tries to nudge ever so slightly in each dimension to find the best line to proceed in, but obviously shifting an image by 0.1490 pixels really doesn't do much, while shifting it by 0.1490 radians naturally does. I don't know, however, where 0.1490 actually came from.</p>
  
  <p><a href="http://www.mathworks.nl/help/toolbox/optim/ug/fminunc.html#f854831" rel="nofollow">The documentation</a> doesn't seem to give advice here. How can I increase the initial step of the solver?</p>