In MatLab, I (after an extended code run) have several .mat files output to .mat files. The actual matlab name for each .mat file is called results , but I used the save command to write them to different files. A small subset of files looks like this:
results_test1_1.mat results_test1_2.mat results_test1_3.mat results_test1_4.mat results_test2_1.mat results_test2_2.mat results_test2_3.mat results_test2_4.mat
Now I want to compare the results for each test, which means that I have to load all four .mat files and combine them in a graph. Reading in one file and creating the final graph is not a problem. But since all files have the same name matlab results , iterative loading is not an option (at least not the one I know about yet), since in the end only file 4 remains, since it overwrites the previous ones.
Is there a way to load all of these files and save them in different variables in the structure (for only one test suite)? Because all this by hand is a hell of a lot of work.
I tried using this method: Upload multiple .mat files to the Matlab workspace , but I get an Invalid field name error on loaded.(char(file)) = load(file);
source share