Error when loading structure in MATLAB 7.5.0

2 Ansichten (letzte 30 Tage)
Ryan Caldwell
Ryan Caldwell am 26 Mai 2015
Kommentiert: Walter Roberson am 10 Jun. 2015
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
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.
Ryan Caldwell
Ryan Caldwell am 26 Mai 2015
Thanks for replying. I saved the variable, cleared the workspace and immediately attempted to load it again, which is when I saw the error, so no changes had been made to the directories. I don't know where the saved function handle would come into play, as the structure only (to my knowledge) contained scalars, numeric arrays and date fields.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Walter Roberson
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.
  1 Kommentar
Ryan Caldwell
Ryan Caldwell am 26 Mai 2015
Thanks for the response. Everything was performed in MATLAB 7.5.0. Unfortunately, attempting what you suggest does not generate anything different.

Melden Sie sich an, um zu kommentieren.


Dave
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
Walter Roberson
Walter Roberson am 10 Jun. 2015
In R2007b that the poster has, graphics handles were still doubles.

Melden Sie sich an, um zu kommentieren.

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!

Translated by