MATLAB: How to save the csv file with different name in a loop after every iteration digital image processingimage processingMATLAB I have vector having one column and "x" number of rows(number of rows in each iteration is changed).So,how i can save the vector of every iteration. csvwrite('im%k.csv',b') Best Answer csvwrite( sprintf('im%d.csv',k), b') Related SolutionsMATLAB: How to load multiple csv files and save them after converting into arff files datadir = 'C:\Users\Name\Documents\MATLAB';d = dir(fullfile(datadir, '*.csv')); for i=1:length(d) filename = fullfile(datadir, d(i).name); MATLAB: How to save multiple plots to separate image files with variable file name "...if I create a plot of intensity for every row of pixels and save evey plot to separate image files, I have to use variables in image file name."Yes, you will have to use variables in the filename. And that is easy with sprintf, something like this:im = your 1394x1040 imagefor k = 1:size(im,1) row = im(k,:); ... process and plot of each row fnm = sprintf('Plot %d.png',k); saveas(gcf,fnm)end Related QuestionThe global value changes for every iterationHow to populate a csv file in a loop without overwriting it? I want to place each vector in a single row on each iteration. But the solution overwrites and creates a new csv each iteration.How to save output of variable in csv file in one column like vectors
Best Answer