필터 지우기
필터 지우기

Returning output argument from standalone executable

조회 수: 5 (최근 30일)
Rashmi Murthy
Rashmi Murthy 2016년 4월 7일
답변: Antti 2018년 1월 26일
I am calling a matlab executable by providing input arguments from the python script. Will Matlab Executable return the output argument back to python after completing execution?
This is the illustration of how I am calling the function python script
os.system('run_matlabcode.sh /usr/local/MATLAB/MATLAB_Compiler_Runtime/v83/ 1000 1100')
The Matlab code named matlabcode.m which is converted to a standalone executable should have an output count
function count=cellcount(frame1,frame2)
How can I return the value of 'count' back to the python program? Please help!
~Rashmi

답변 (1개)

Antti
Antti 2018년 1월 26일
Instead of a standalone executable, you should use a python library compiled with MATLAB Compiler SDK. It allows you to call MATLAB functions from Python, and transfer inputs and outputs more easily. See Compiler SDK documentation. If you cannot use compiled Python libraries, then I think the only option is to have the MATLAB executable write the output to a file, and have the Python application read the results from the file.

카테고리

Help CenterFile Exchange에서 Python Package Integration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by