객체 저장과 불러오기
객체 저장과 불러오기 프로세스 사용자 지정
MATLAB®은 객체에 대해 load
함수와 save
함수를 사용하기 위한 디폴트 동작을 제공하지만, 사용자가 다음 두 방법 중 하나를 사용하여 객체 직렬화(저장)와 객체 역직렬화(불러오기) 프로세스를 사용자 지정할 수 있습니다.
권장됨:
matlab.mixin.CustomElementSerialization
(R2024b 이후)에서 상속.
자세한 내용은 When to Customize the Serialization Process 항목을 참조하십시오.
클래스
matlab.mixin.CustomElementSerialization | Customize how objects are serialized and deserialized (R2024b 이후) |
matlab.serialization.ElementSerializationContent | Representation of serialized object (R2024b 이후) |
matlab.serialization.SerializationContext | Context in which objects are serialized (R2024b 이후) |
도움말 항목
객체에 대한 save
및 load
의 디폴트 동작
- 객체의 저장 및 불러오기에 대한 디폴트 프로세스
MATLAB은 객체를 직렬화(저장)하고 역직렬화(불러오기)할 때 몇 가지 기본 지침을 따릅니다. - Avoid Property Initialization Order Dependency
Avoid initialization order dependency by defining set methods for dependent properties.
객체 직렬화 사용자 지정
- When to Customize the Serialization Process
Modify the save and load process for objects. - Maintain Backward and Forward Compatibility Between Class Definitions
Modify the save and load process to provide class version compatibility. - Serialization with Class Hierarchies
Subclasses can callmatlab.mixin.CustomElementSerialization
methods of their superclasses. - Transitioning Serialization and Deserialization Processes to matlab.mixin.CustomElementSerialization
Consider transitioning tomatlab.mixin.CustomElementSerialization
from olderloadobj
andsaveobj
implementations. - Code Patterns for saveobj and loadobj
Use these patterns to implement custom save and load processes usingsaveobj
andloadobj
.