I don't think a zeropad approach would be optimal, the main problem is that your vector can increase size every time as the same time as your inputs can be smaller. To solve this you can use a cell array which can hold different size vectors without problem. This code solves your problem:
clear
clc
close all
imageFolder = 'D:\Research File\September 26\C001H001S0001';
i = cell(925,1);
j = cell(925,1)
for k = 1:925
tifFilename = sprintf('C001H001S0001000%03d.tif', k);
fullFileName = fullfile(imageFolder, tifFilename);
if exist(fullFileName, 'file')
imageData = imread(fullFileName);
Pic=imageData/64;
else
warningMessage = sprintf('Warning: image file does not exist:\n%s', fullFileName);
uiwait(warndlg(warningMessage));
end
image(Pic);
colormap(bone);
xlabel('$x$','fontsize',24,'interpreter','latex');
ylabel('$y$','fontsize',24,'interpreter','latex');
[i{k},j{k}]=getpts;
end
Best Answer