So Matlab doesn't support this type of thing, which can't really be too surprising. The best way I've found to get around this is to just redefine saveobj() and loadobj() methods, while having all "special" data stored in a dedicated struct that is purpose built for properties that can't be saved normally. For example, if is a property that reference another object, but you just want to save a "reference" (like through a UID), make the property transient, and saveobj() and loadobj() are then responsible for saving the UID to the dedicated save struct and attempting to find the old reference through the saved UID when loading.
2 Comments
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/479759-custom-class-property-and-method-attributes#comment_763519
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/479759-custom-class-property-and-method-attributes#comment_763519
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/479759-custom-class-property-and-method-attributes#comment_763606
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/479759-custom-class-property-and-method-attributes#comment_763606
Sign in to comment.