How do I access properties of Matlab handle objects in compiled python packages using only the runtime?

3 ビュー (過去 30 日間)
FS
FS 2023 年 7 月 7 日
回答済み: Taylor 2024 年 9 月 9 日
I have received a python package generated by Matlab 2020b that returns some calculation results. This package does not have a Sample.py included. On my machine, I am using only an installed runtime and have installed the package. When I initialize() the package in python and call the relevant method with some data parameters, all is fine - the calculation runs. I receive an output object that is of the type matlab.object - a matlab handle object, as far as I understand. I also know the classdef of the result object in Matlab, it is something like this:
classdef SomeResultClass
properties (Access = public)
OneProperty;
AnotherProperty;
end
end
How do I access the properties through this handle object in Python? Is it even possible when SomeResultClass does not have "handle" as a super class? The matlab.engine methods like getfield and subsref are not available when only the runtime is installed.
Thank you!

回答 (1 件)

Taylor
Taylor 2024 年 9 月 9 日
print(dir(myObj.__dict__))

カテゴリ

Help Center および File ExchangePython Package Integration についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by