Why we do defined objects are saved as unit32 in .mat files ?
显示 更早的评论
In other words, how to save them as objects ?
Thanks
9 个评论
Jan
2017-12-14
Please post any details: How do you save what in which kind of file?
Dalia Sobhy
2017-12-14
编辑:Dalia Sobhy
2017-12-14
Please post the command you used for saving. Which MAT file format are you using? This can be defined in the Preferences. Older MAT file formats might convert the objects to byte streams - but I cannot imagine, where UINT32 is coming from. Maybe you can provide such a MAT file here?
Dalia Sobhy
2017-12-14
Steven Lord
2017-12-14
When you try to load the data, is the class definition file for your object available to MATLAB? Is it on the path?
Do you receive any warning when you load your data, and if so what is the full text of that warning? [If you do remember receiving a warning but turned some or all warnings off, turn the warnings back on them load the data to see the text of the warning.]
Dalia Sobhy
2017-12-14
Jan
2017-12-14
Ahhh. This message is very useful. Didn't you see it before or did you not post it, because you thought it is not important?
The "path" means Matlab's path command: All folders included in Matlab's path. Type this in the command window:
path
Dalia Sobhy
2017-12-14
编辑:Stephen23
2017-12-15
Dalia Sobhy
2017-12-14
回答(1 个)
Jan
2017-12-15
how to add path permanently
addpath D:\MFiles\YourFolder -end
savepath
Look in the documentation of addpath: https://www.mathworks.com/help/matlab/ref/addpath.html. At the bottom you find the "See also" line, which contains useful related commands. Here the gem savepath is mentioned.
Alternatively you can do this using the pathtool: Select the folder in a GUI and save the path permanently.
Sometimes there are problems saving the path, if the user does not work with admin privileges (but this is a good idea!). Then writing to matlabroot\toolbox\local\pathdef.m does not work. I solve this by allowing users to modify this file in the Window Explorer.
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!