Total Matlab noob here. Thanks to these forums, I've managed to split a larger image into a grid of much smaller images. I've also managed to save each of these smaller images as a .png. However, I wish to save these images with file names relevant to their location in the grid. (The upper left block would be A_001, the block one to its right would be B_001, the one below that would be B_002, etc.) However, I am unsure how to do this. I'll show the relevant code below.
fprintf('plotindex = %d, c=%d, r=%d\n', plotIndex, c, r);
subplot(numPlotsR, numPlotsC, plotIndex);
[rowsB columnsB numberOfColorBandsB] = size(rgbBlock);
plotIndex = plotIndex + 1;
filename = sprintf('%d.png', K);
The first, much larger part of the code shows how we define %d. For the very first block, %d is 1, for the second, %d is 2, etc. The last few lines at the very end show how we name each individual photo file after %d. However, this is as far as I've gotten. I have tried altering the bottom lines, but everything I've tried has resulted in an error. Is there a way to name images in the grid fashion by using %d? Do I need a whole nother system all together?