I have 15 .txt files that I choose them from my directory and I need to change their structure and save them as .mat files. So far I can only do this for 1 file.
Here is my code:
d=dir;dstr={d.name};[s,ok]=listdlg('PromptString','Select Catalog:',... 'SelectionMode','Double',... 'ListString',dstr);fid=fopen(dstr{s});a=fscanf(fid,'%4d %2d %2d %2d %2d %g %g %g %g %g \n',[10,inf]);a=a';fclose(fid);%--------------------------------------------------------------
IDQ=a;% time
year = IDQ(:,1);month = IDQ(:,2);day = IDQ(:,3);hour = IDQ(:,4);minute = IDQ(:,5);second = IDQ(:,6);timeVec = [year,month,day,hour,minute,second];time = datenum(timeVec);catalog.time = time;save('catalog.mat','catalog');
Best Answer