How to name a Matlab output file using input from a text file -


i trying take input text file in format:

processed_kplr010074716-2009131105131_llc.fits.txt processed_kplr010074716-2009166043257_llc.fits.txt processed_kplr010074716-2009259160929_llc.fits.txt etc.... (there several hundred lines) 

and use input name output files matlab loop. each time loop ends, process results , save them file such as:

matlab_processed_kplr010074716-2009131105131_llc.fits.txt 

this make identifying object has been processed easier can id number , not of sort through list of random saved filenames. need save plots generated in each loop in similar fashion. have far:

filenames = fopen('file_list_1.txt', 'rt'); intext = textscan(filenames, '%s'); outtext = [intext]'; fclose(filenames)  j:numel(data) %do stuff save(strcat('matlab_',outtext(j),'.txt')) print(plot, '-djpeg', strcat(outtext(j),'.txt')) end 

any appreciated, thanks.

if want use save command save text file, need use -ascii tab, see documentation more details. might want use dlmwrite instead(or fprintf, don't believe can write whole matrix @ once fprintf, have loop on rows).


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -