title: Saving Blocks of cropped image Resulted from blockproc in Matlab
body: <p>I've been trying to crop and save the blocks (subimages) from the original image using blockproc and imcrop functions, but I couldn't. I'm only able to see the figures of the blocks. Is there any way to save these blocks to the specified folder? Thanks.</p>
  
  <pre><code>clear all
  close all
  clc
  a = imread('3.jpg');
  folderPath='C:\Program Files\Folder';
  blockSize = [70,70];
  d = blockproc(a,blockSize,@(bs) imcrop(bs.data));
  %blockproc(a, blockSize, @(bs)imcrop(bs.data),'BorderSize', [1 1 ]);
  
  %i=1;
  fileName = [folderPath num2str(i) '.jpg'];
  imwrite(d, fileName, 'jpg');
  </code></pre>