I have a number of .mat files in a folder called m2.mat, m3.mat, m4.mat and so on all the way to m400.mat. When each .mat file is loaded into Matlab, the associated workspace variable has a different name. For example, m2.mat has a workspace name as data_run_2, and m3.mat has a workspace name as data_run_3. I would like all worspace variables to have the same name as the .mat file name, thus m2.mat would have the workspace name m2. Is there a way to programatically perform this operation for all of the 400 files?
Thanks so much for the assistance!
Best Answer