Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Pass Data to MATLAB from Python

When you pass data as input arguments to MATLAB® functions from Python®, MATLAB converts the data into equivalent MATLAB data types.

Python Input Argument Type

Resulting MATLAB Data Type
(scalar unless otherwise noted)

matlab numeric array object (see MATLAB Arrays as Python Variables.

Numeric array

float

double

complex

Complex double

int

int32(Windows®)

int64(Linux® and Mac)

long [a]

int64

float('nan')

NaN

float('inf')

Inf

bool

logical

str

char

bytearray

uint8 array

bytes

uint8 array

dict

Structure if all keys are strings
Not supported otherwise

list

Cell array

set

Cell array

tuple

Cell array

memoryview

Not supported

range

Cell array

None

Not supported

module.type

Not supported

[a] 

long is a data type of Python 2.7 only

Related Topics

Was this topic helpful?