Calling python special methods from matlab
조회 수: 6 (최근 30일)
이전 댓글 표시
In python, it is not uncommon to have methods or constants with a single or double underscore such as
__VERSION__
__len__()
Trying to access these from matlab via for example
py.numpy.__version__
results in the following error:
Error: The input character is not valid in MATLAB statements or expressions.
Is there a reliable way to call these variables or functions?
댓글 수: 0
채택된 답변
Rachana Reddy Mamilla
2018년 8월 13일
Hello Marco, There are some features of python which are not supported by MATLAB .One of which includes the inability to access Class names or other identifiers starting with an underscore (_) character. Instead, use the Python py.getattr and py.setattr functions. Hope this link helps.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!