title: Finding Minimum and Maximum points on Profile using MATLAB
body: <p><img src="https://i.stack.imgur.com/UhZWE.jpg" alt="Profile"></p>
  
  <p>I have extracted profile on cross-section of vessel by following code</p>
  
  <pre><code> imshow(image); % image is not shown
   [cx,cy,c,xi,yi] = improfile;
  </code></pre>
  
  <p>Here c is the intensity along the profile and I plot them using:</p>
  
  <pre><code> x=1:length(c);
   figure
   plot(x,c,'o')
   axis([0 45 80 150])
  </code></pre>
  
  <p>and it look like the one I have uploaded.
  c is 33X1 intensity vector where, c=[123  126 131   138 139 141 143 143 144 141 136 126 102 96 91 100 100 113 109 96 94 90 101 107 116 123  127 130  131 132 131  129 131]; </p>
  
  <p>I want to detect index of c  to find  A (max in left side),B (max in right side),C (min in left side), D(min in rt side) and E (middle) points in the profile.</p>