title: Index exceeds matrix dimensions when trying to access position vectors
body: <p>I am simply reading an image and wish to visualize the bounding boxes returned by blob analysis of matlab which returns position vectors.
  Here is my code </p>
  
  <pre><code>img = imread(file_name);
  img = im2bw(img);
  
   gblob = vision.BlobAnalysis('AreaOutputPort', true, ... % Set blob analysis handling
                  'CentroidOutputPort', true, ...
                  'BoundingBoxOutputPort', true', ...
                  'MinimumBlobArea', 0, ...
                  'MaximumBlobArea', 600000, ...
                  'MaximumCount', 1000, ...
                  'MajorAxisLengthOutputPort',true, ...
                  'MinorAxisLengthOutputPort',true, ...
                  'OrientationOutputPort',true);
  
  
              [Area,centroid, bbox, MajorAxis, MinorAxis,Orientation] = step(gblob, img);
              % each bbox is position vector of the form [x y width height]
               for i = 1:1:length(MajorAxis)
                   figure;imshow(img(bbox(i,2):bbox(i,2) + bbox(i,4),bbox(i,1):bbox(i,1)+bbox(i,3)));
               end
  </code></pre>
  
  <p>On doing so i get an error <code>Index exceeds matrix dimensions.</code> I have also tried </p>
  
  <pre><code>figure;imshow(img(bbox(i,1):bbox(i,1) + bbox(i,3),bbox(i,2):bbox(i,2)+bbox(i,4)));
  </code></pre>
  
  <p>but i still end up getting the same error.</p>
  
  <p>here is a sample image where this code gives an error </p>
  
  <p><img src="https://www.aagga.com/wp-content/uploads/2016/02/Sample.jpg" alt="https://www.aagga.com/wp-content/uploads/2016/02/Sample.jpg"></p>