Can I define a specific method to run upon loading obj from mat file?

4 Ansichten (letzte 30 Tage)
I have a class with a constructor which works fine. When loading the obj from a mat file however I would like another method to run instead of the constructor. Is that possible to define?

Antworten (2)

Micke Malmström
Micke Malmström am 17 Mai 2022
Unless there is a specific way to do this I realized I could use
with a switch statment (looking at the data in the obj) in the constructor to decide which type of load should be performed.

Steven Lord
Steven Lord am 17 Mai 2022
From the documentation section talking about how to customize object saving and loading, overload the loadobj method.


Mehr zu Construct and Work with Object Arrays finden Sie in Help Center und File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by