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

조회 수: 4 (최근 30일)
Micke Malmström
Micke Malmström 2022년 5월 17일
답변: Steven Lord 2022년 5월 17일
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?

답변 (2개)

Micke Malmström
Micke Malmström 2022년 5월 17일
Unless there is a specific way to do this I realized I could use
ConstructOnLoad
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 2022년 5월 17일
From the documentation section talking about how to customize object saving and loading, overload the loadobj method.

카테고리

Help CenterFile Exchange에서 Construct and Work with Object Arrays에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by