How to run a user input MATLAB function in Python
9 ビュー (過去 30 日間)
古いコメントを表示
Hi
triarea.m
from a python script as follows:
import matlab.engine
eng = matlab.engine.start_matlab()
eng.triarea(nargout=0)
What if, we had a variable in Python with the MATLAB filename input by the user,
file_name = 'triarea'
then,
eng.file_name(nargout=0)
returns the error
MatlabExecutionError: Undefined function 'file_name' for input arguments of type 'double'.
How can we run the user input MATLAB function in Python?
In my actual problem, the file_name is input while instantiating an object of a class and is stored as an object attribute. Then one of the methods of the object calls this MATLAB file.
0 件のコメント
回答 (1 件)
Shishir Singhal
2020 年 4 月 6 日
Hi,
Please refer though this link : https://stackoverflow.com/questions/58196433/how-to-run-a-user-input-matlab-function-in-python
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Call MATLAB from Python についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!