C Math Library Reference | ![]() ![]() |
Create a matrix of double precision values
C Prototype
mxArray *mlfDoubleMatrix(int m, int n, const double *pr, const double *pi);
Arguments
int m
Number of rows.
mxArray
array vector of real values.
const double *pi
mxArray
array vector of imaginary values. Specify NULL
if there is no imaginary part.
Description
This routine creates a complex, two-dimensional array whose contents are initialized to the real part, pr
, and the imaginary part, pi
.
Example
This example creates a 3-by-2 matrix of double precision, complex numbers.
static double real_data[] = { 1, 2, 3, 4, 5, 6 }; static double cplx_data[] = { 7, 8, 9, 10, 11, 12 }; mxArray *mat1 = NULL; mlfAssign(&mat1, mlfDoubleMatrix(3, 2, real_data, cplx_data));
![]() | mlfCreateColonIndex | mlfEnd | ![]() |