MATLAB: Load function sometimes alters structure name in the Workspace

load workspace structureMATLAB

I am encountering a weird phenomena where using the load('filename') function to load a structure, alters the structure name in the workspace. This does not occur everytime, but I observed it on multiple occasions:
Example:
close all
clear variables
load('TM24_w')
results in a structure in my workspace named: "TM242_w"
It does load in the correct structure with the correct fields and values but the workspace name is wrong.
Has anyone ever encountered this and is there a solution?

Best Answer

When you load a mat file without output on the load command, the variable names will be the same as the names inside the mat and not what the file name happens to be.
Related Question