load function sometimes alters structure name in the Workspace
4 次查看(过去 30 天)
显示 更早的评论
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?
5 个评论
采纳的回答
Walter Roberson
2020-7-21
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Workspace Variables and MAT Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!