- eng.getfield(tr, 'Base'). This getfield function is designed for structure, and it works for class but may not work in the future.
- eng.subsref(tr, {'type':'.','subs':'Base'}). This usage is a little tedious but should work in long term.
- Add a get method to the class for each property to be accessed by Python.
Accessing matlab object properties from Python
19 次查看(过去 30 天)
显示 更早的评论
I'm compiling a matlab handle object and instantiating it from Python using the Matlab Compiler Runtime.
I manage to call instance methods as it is done in this example https://www.mathworks.com/help/matlab/matlab_external/use-matlab-handle-objects-in-python.html
However, how can I get properties?, i.e., from the example in the link above how do I write in Python "b = tr.Base"
0 个评论
采纳的回答
Bo Li
2016-11-30
I can think of following three approaches:
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Compiler SDK 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!