I am writing a code to automate some data processing. For this, I load in several files containing structs. I'd like to combine these structs as fields in a struct called "Data". Each file is named according to the date it was obtained.
The code is able to produce the struct with all data inside, but the structure of the struct is not as desired. For example, instead of "Data.D20190501.datainstruct" it becomes "Data.D20190501.D20190501.datainstruct". Can the desired format be achieved?
% Day strings to use in file names.
d = ["01"; "10"; "13"; "15"];% Take files out of every folder (Day #n)
for n = 1:3 % Define path per day. (name of the struct in the file)
main = sprintf('D201905%s', d(n+1)); % Load all combined datasets.
Data.(main) = load(sprintf('../path/Day %d/file', n));end
Best Answer