Output array from Python called function

3 ビュー (過去 30 日間)
George Nehma
George Nehma 2024 年 5 月 13 日
コメント済み: George Nehma 2024 年 5 月 13 日
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 ?
George Nehma
George Nehma 2024 年 5 月 13 日
Yes, I just did np.array(X_exact) on the output and it worked. Thank you very much.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

タグ

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by