Skip to content

np2mat

matlab_compat · scripts/matlab_compat/np2mat.m

NP2MAT  Convert a py.numpy.ndarray to a MATLAB numeric array.

  A = np2mat (P)          converts via double (P) (MATLAB default).
  A = np2mat (P, 'single') converts via single (P).
  A = np2mat (P, 'double') converts via double (P).

  Matches the MATLAB R2026a Python->MATLAB conversion helpers shown for
  buffer-protocol NumPy arrays (use double/single on the py object).

  See also mat2np, cell2py, py.numpy.array, double, single.