solved the problem. Below is the code if anyone facing the similar problem:
[listOfFiles, folder] = uigetfile ('*.tif', 'Select your image', 'MultiSelect', 'on');
fullFileName = fullfile(folder, listOfFiles{1});
[I,cmap] = imread(fullFileName);
[rows, columns] = size(I);
image3d = zeros(rows, columns, NumImages);
if NumImages ~= length(listOfFiles)
msg = 'Error Occured - Image Number Mismatch';
error(msg);
else
for k = 1 : length(listOfFiles)
fullFileName = fullfile(folder, listOfFiles{k});
thisImage = imread(fullFileName);
image3d(:,:,k) = thisImage;
end
cd 'C:\NO PLIF data\6 Dec 2017\sample';
load test1.txt;
A=textread('test1.txt');
for k=1:length(listOfFiles)
filename=sprintf('%d.tif',k);
filename1=image3d(:,:,k)./A(k);
saveastiff(filename1,filename);
end
end