set methods getting called before loadobj?

1 次查看(过去 30 天)
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.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Object Save and Load 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by