I'm trying to load about 40 files into MATLAB, all of who's names and locations are the same apart from 2 variable pieces. They each contain 5000 datapoints, which I want to combine into 1 single vector. They are HDF5 files, so I also have to specify the path inside the file, the name of which contains these variables too.
An example of loading one of these files would be
ROdata = double(h5read('directories\010340text2\010340text2.hdf5','/othertext2'));
Here, the variables would be 010340 and 2. So the general form is something like (n terms of x and y)
ROdata = double(h5read('directories\xtexty\xtexty.hdf5','/othertexty'));
Both x and y I have in an array already loaded into MATLAB.
From this point, I'm pretty clueless. I suppose num2str comes in somewhere, but I've tried a few things (like in the video http://blogs.mathworks.com/videos/2009/07/02/advanced-loading-files-using-their-names-for-variable-names/) but that doesn't work, as the variable part is inside the text, not at the end.
I could of course do so manually, but these 40 are from a series of around 300, so that'll be a lot of writing.
dirfunction using wildcards:filenames = dir('directories\*text*\*text*.hdf5');dircommand can accept wildcards in folder names.