Import multiple data files and assign to variables
2 views (last 30 days)
Show older comments
I would like to import multiple data files and assign their contents to a variable.
BurnIn_2ndary_20150527_1940.mat
BurnIn_2ndary_20150528_1500.mat
BurnIn_2ndary_20150528_2200.mat
BurnIn_2ndary_20150529_1500.mat
BurnIn_2ndary_20150530_1000.mat
BurnIn_2ndary_20150530_2200.mat
BurnIn_2ndary_20150531_1600.mat
Each file consists of a 7x4 matrix (called 'details') that consists of the mean, std, min, and max values for 7 different parameters determined by data from its original file.
I am continually adding files to the folder for each set of data I get daily sometimes twice a day. I need to be able to import all files and assign them to different variables that could range to infinity (because I am continuously adding files).
I tried this
dir *2ndary*.mat
files = dir('*.mat');
for i=1:length(files)
eval(['load ' files(i).name]);
end
But I still don't know how to assign each matrix to a new variable for further use. I am worried that maybe because each matrix is called 'details' in each file from previous code might cause an issue
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Structures 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!