Skip to content

cell2py

matlab_compat · scripts/matlab_compat/cell2py.m

CELL2PY  Convert a MATLAB value to an explicit py.* object.

  OUT = cell2py (C)  converts cell C to py.list (element-wise).
  OUT = cell2py (S)  converts scalar struct S to py.dict.
  OUT = cell2py (X)  converts numeric/logical X to py.numpy.ndarray.
  OUT = cell2py (T)  converts char/string scalar T to py.str.

  Nested cells and scalar structs are converted recursively.  This is
  the Nexus helper for the MATLAB R2026a conversion table (Pass Data
  Between MATLAB and Python): cell vectors become Python sequences,
  structs become mapping objects, and numeric arrays become NumPy.

  See also mat2np, np2mat, py.list, py.dict, py.numpy.array.