set methods getting called before loadobj?

1 view (last 30 days)
Joseph Burgel
Joseph Burgel on 20 May 2011
Hi all,
I've got a user defined object that was saved to a file. One of the properties of the class has a set method defined for it. I've also defined a static loadobj method for the class. When I load the object from the file using load(), the set method for the property gets called before the loadobj. Why is this? Initially, the property was not transient so it was saved to the file. In my latest class revision, I've changed the property to be transient.
Also, I'm still not clear on what gets passed to loadobj. In my case, I've saved an object to the file but the input argument to loadobj is a structure. why don't I get an object type passed. Also, the object seems to instantiate regardless of what I return from loadobj - either returning the passed structure or initializing a new object and returning that.

Answers (0)

Categories

Find more on Object Save and Load 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!