How to import around 1000 text files and then convert them from cnv files to matlab files and then organize them in a structure with their original file name?
Show older comments
Hello Community,
This question has multiple parts in it, so I will break it down.
-Import multiple cnv files.
-Convert the cnv files into multiple arrays for each file (I have a function called cnv2mat.m that converts a cnv file to 6 arrays called (lat,lon,gtime,data,names,sensors)
note: the files have to be characters when they are used in this function so
FILE='05070601.cnv';
[lat,lon,gtime,data,names,sensors]=cnv2mat(FILE);
-Finally I want to create a structure that we'll call data, that has a number associated for each cnv file and then 6 arrays for each of those files.
For a reference, one of the names of the files is 00092600.cnv (which references year 2000,mon 9, day 26, and 00 means first cast on that day)
Any help would be greatly appreciated. Thanks in advanced.
Andrew
Accepted Answer
More Answers (1)
per isakson
on 17 Mar 2014
Edited: per isakson
on 17 Mar 2014
Allocate the structure with this statement before the for-loop
data = struct('Filename',{FILES.name},'lat',[],'long',[]);
then you may overwrite the names in the loop.
.
Here are some links on debugging in Matlab
Categories
Find more on Standard File Formats in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!