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

8 Ansichten (letzte 30 Tage)
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 Kommentar
Stephen23
Stephen23 am 13 Nov. 2024
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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Taylor
Taylor am 13 Nov. 2024
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

Kategorien

Mehr zu Call Python from MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by