I wish to select a different number of data points for different image in this loop but I can't do that since it gives me an error "Unable to perform assignment because the size of the left side
is 3-by-1 and the size of the right side is 4-by-1.". Is there a way to make the 3-by-1 to 4-by-1 by adding zeros as needed?
clear clcclose all% Read images in order from 1 to 925.
% Files are in the "myFolder" directory.
imageFolder = 'D:\Research File\September 26\C001H001S0001';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