Loading mat files does not support enumerations with function handles?

I basically have an enumeration class with one property being a handle. After saving an instance (TestEnum.a) to a mat file and loading it again I am facing the following warning:
Warning: The value of enumeration member 'a' differs from when the enumeration was saved. 'a' will be loaded with the new value.
Why is that the case? I have noticed that this does not happen in case the property is anything else?
classdef TestEnum
properties
hdl
end
enumeration
a (@(x) x)
end
methods
function obj = TestEnum(hdl)
obj.hdl = hdl;
end
end
end

답변 (1개)

Steven Lord
Steven Lord 2021년 8월 29일

1 개 추천

The question of whether two function handles are the same is a bit complicated.

댓글 수: 1

Okay I understand the issue but what options do I have to work around it?
Customizing the save and load process was my initial idea. Unfortunately I have noticed that for enumerations the loadobj(s) function is never called.

댓글을 달려면 로그인하십시오.

카테고리

제품

릴리스

R2021a

질문:

2021년 8월 28일

댓글:

2021년 8월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by