Error when loading structure in MATLAB 7.5.0
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a structure into which I have saved substructures containing string and array data types. Typically, when saving with new data I select the structure from the workspace, click Save As: [same file name] and overwrite the previous version. This has worked fine until now. When I try to load my most recently saved version, I encounter the message:
Warning: Could not find appropriate function on path loading function handle C:\Program Files\MATLAB\R2007b\toolbox\matlab\graphics\@graphics\@ploteditbehavior\schema.m>doEnableAction
Warning: An invalid object is being loaded
??? Error using ==> load root class can not be instantiated.
The file size is only 3.7MB. Is there anything I can do to recover this data?
Edit: the file in question is attached in case anyone feels inclined to give it a shot. I realized that I inadvertently saved much more to the variable, including two data acquisition objects. However, despite including those objects I have been since unable to replicate the error, all dummy structures I create load properly.
2 Kommentare
James Tursa
am 26 Mai 2015
Looks like MATLAB cannot find the function associated with the saved function handle. Check to see that the directories and function m-file still exists.
Antworten (2)
Walter Roberson
am 26 Mai 2015
You saved a graphics object and now it is having difficulty restoring it. The graphics object appears to have to do with the Plot Editor.
Are you possibly trying to restore to an earlier version of MATLAB than you saved the file in? Right around that release there was a change in some of the graphics objects that made some of them not loadable in previous versions.
I think you may be able to restore anything that does not have a graphics object in it, by specifying the variable name at the time you load. For example,
load('MyFile.mat', 'Xattenuated')
to load the "Xattenuated" variable. You can use
whos -file MyFile.mat
to get the names of the saved variables.
Dave
am 10 Jun. 2015
As others have brought up, the problem is that MATLAB HG object handles went from being doubles to actual handles.
What I did is, before I save, I strip the handle objects from my structure, but save the attributes of the objects I want to restore upon reload (say, for an IMROI, position, color, etc.). When I load it back up, it restores them automatically. It's a bit of extra work, but not too hard.
1 Kommentar
Siehe auch
Kategorien
Mehr zu Environment and Settings finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!