Output array from Python called function

I call a MATLAB function from my python script, where the output of the MATLAB function is a 6x801 matrix. When I call the function in python however, I only get the first column (6x1 vector) as my output in python.
Inside python I call:
eng.matlab.engine.start_matlab()
X_exact = eng.testplot(randalt,nargout=1)
Where testplot is the function being called, randalt is a float input parameter to the function.

댓글 수: 2

Stephen23
Stephen23 2024년 5월 13일
편집: Stephen23 2024년 5월 13일
Python does not (natively) support matrices. Did you take a look at the sizes of the vectors inside that 6x1 vector ?
Yes, I just did np.array(X_exact) on the output and it worked. Thank you very much.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

제품

릴리스

R2024a

태그

질문:

2024년 5월 13일

댓글:

2024년 5월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by