title: Creating image profiles in some parts of the image
body: <p>I've been struggling with a problem for a while:) in Matlab.
  I have an image (A.tif) in which I would like to find maxima (with defined threshold) but more specific coordinates of these maxima. My goal is to create short profiles on the image crossing these maxima (let say +- 20 pixels on both sides of the maximum)
  I tried this:</p>
  
  <pre><code>[r c]=find(A==max(max(A)));
  </code></pre>
  
  <p>I suppose that <code>r</code> and <code>c</code> are coordinates of maximum (only one/first or every maximum?)
  How can I implement these coordinates into ,for example <code>improfile</code> function?
  I think it should be done using nested loops?</p>
  
  <p>Thanks for every suggestion</p>
  
  <p>Your code is working but it finds only global maximum coordinates.I would like to find multiple maxima (with defined threshold) and properly address its coordinates to create multiple profiles crossing every maximum found. I have little problem with improfile function :</p>
  
  <p>improfile(IMAGE,[starting point],[ending point]) .</p>
  
  <p>Lets say that I get [rows, columns] matrix with coordinates of each maximum and I'm trying to create one direction profile which starts in the same row where maximum is (about 20 pixels before max) and of course ends in the same row (also about 20 pixels from max) .</p>
  
  <p>is this correct expression :improfile(IMAGE,[rows columns-20],[rows columns+20]); It plots something but it seems to only joins maxima rather than making intensity profiles</p>