How can I create a tuple and dictionary in MATLAB? Whether I have to import any python modules to create such things?

조회 수: 7 (최근 30일)
a=py.tuple({'Robert',19,'Biology'});
disp(a);
But it doesn't work? Is there any solution to this? or Whether I have import any python modules?
  댓글 수: 1
Stephen23
Stephen23 2024년 11월 13일
It works:
a = py.tuple({'Robert',19,'Biology'})
a =
Python tuple with values: ('Robert', 19.0, 'Biology') Use string, double or cell function to convert to a MATLAB array.
disp(a)
Python tuple with values: ('Robert', 19.0, 'Biology') Use string, double or cell function to convert to a MATLAB array.

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

답변 (1개)

Taylor
Taylor 2024년 11월 13일
The commands you've shared do work. Double check your system configuration https://www.mathworks.com/help/matlab/matlab_external/install-supported-python-implementation.html

카테고리

Help CenterFile Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by