MATLAB Answers


Calling python special methods from matlab

Asked by Marco Halder on 1 Aug 2018
Latest activity Commented on by Marco Halder on 13 Aug 2018
In python, it is not uncommon to have methods or constants with a single or double underscore such as
Trying to access these from matlab via for example
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?


Sign in to comment.


1 Answer

Answer by Rachana Reddy Mamilla on 13 Aug 2018
 Accepted Answer

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.

  1 Comment

Sign in to comment.