how to store many result in csv file in a row ?

9 views (last 30 days)
sumu nowshin
sumu nowshin on 7 Aug 2018
Edited: Jan on 9 Aug 2018
I have 20+ images in a folder and want to store their feature result in CSV file. here is my code :
srcFiles = dir('D:\study\iccit_confr\mono\*.jpg'); % the folder in which ur images exists
for i = 1 : length(srcFiles)
filename = strcat('D:\study\iccit_confr\mono\',srcFiles(i).name);
I = imread(filename);
%figure, imshow(I);
I2 = imcrop(I);
figure, imshow(I2)
u=lbp(I2);
disp(u)
csvwrite('test.csv',u)
end
I have LBP function file. By this code only last result stored in CSV file. plz, help by giving a code for solving this.

Accepted Answer

Stephen
Stephen on 7 Aug 2018
Edited: Stephen on 7 Aug 2018
You need to change the filename for each loop iteration, e.g.:
fnm = sprintf('test_%04d.csv',i);
csvwrite(fnm,u)
Otherwise you are simply overwriting the same file on each iteration.
  3 Comments
sumu nowshin
sumu nowshin on 7 Aug 2018
Thank u so much @Stephen Cobeldick.For my research work, I need to store feature values of blood cell images in a CSV file

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!