-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Hi, I cannot set attributes if the class does not import mixin. The following matlab TestObject is in a @TestObject folder and TestObject.m file. I can create an instance of this class in Matlab and change the attribute. I can do:
test = TestObject(2); and if I print test.attribute, it returns 2. If I then do test.attribute = 3;, it will change its value.
However, doing this in Python does not work. The values stays at 2. If I change the Matlab class header to classdef TestObject < matlab.mixin.Copyable, then it works. However, I need to interface to matlab code that does not implement the mixin class. How can I change the attribute of the Matlab class then?
`classdef TestObject
propertiesattribute = 12345; end methods function obj = set.attribute(obj, value) obj.attribute = value; end function obj = TestObject(value) if nargin == 1 obj.attribute = value; else error('Provide value') end end endend`
Metadata
Metadata
Assignees
Labels
No labels