Error when loading structure in MATLAB 7.5.0

1 view (last 30 days)
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 Comments
James Tursa
James Tursa on 26 May 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 on 26 May 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.

Sign in to comment.

Answers (2)

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

Sign in to comment.


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

Sign in to comment.

Categories

Find more on Graphics Object Programming in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!