Why we do defined objects are saved as unit32 in .mat files ?
Show older comments
In other words, how to save them as objects ?
Thanks
9 Comments
Jan
on 14 Dec 2017
Please post any details: How do you save what in which kind of file?
Dalia Sobhy
on 14 Dec 2017
Edited: Dalia Sobhy
on 14 Dec 2017
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
on 14 Dec 2017
Steven Lord
on 14 Dec 2017
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
on 14 Dec 2017
Jan
on 14 Dec 2017
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
on 14 Dec 2017
Edited: Stephen23
on 15 Dec 2017
Dalia Sobhy
on 14 Dec 2017
Answers (1)
Jan
on 15 Dec 2017
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.
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!