Using the C Math Library    

Numeric Arrays

The MATLAB C Math Library includes routines to create and manipulate numeric arrays. Numeric arrays are the fundamental MATLAB array type. The elements of the array are stored as a one-dimensional vector of double-precision numbers. Imaginary data, if present, is stored in a separate vector.

This table lists the MATLAB C Math Library routines that create numeric arrays and perform some basic operations on them. The sections that follow provide more detail about using these routines. For more detailed information about using numeric arrays, see Using MATLAB. For more detailed information about any of the library routines, see the online MATLAB C Math Library Reference.

Table 3-1: Numeric Array Routines
Task
Routine
Create a 1-by-1 array (scalar)
mlfScalar()
Create a 1-by-n array (vector)
mlfColon()
Create an m-by-n array (matrix)
mlfDoubleMatrix() or
mxCreateDoubleMatrix()
Create a multidimensional, (m-by-n-by-p-by...) array
mxCreateNumericArray()
Create a numeric array by concatenating existing arrays
mlfHorzcat()
mlfVertcat()
Create commonly useful, multidimensional arrays, such as arrays of ones, zeros, random numbers, identity matrices, and magic squares.
mlfOnes()
mlfZeros()
mlfRand(), mlfRandn()
mlfEye()
mlfMagic()


 MATLAB Array C Data Type Creating Numeric Arrays