User`s manual
MATLAB Data
1-9
Logical Arrays
Any noncomplex numeric or sparse array can be flagged as logical. The storage
for a logical array is the same as the storage for a nonlogical array.
Empty Arrays
MATLAB arrays of any type can be empty. An empty mxArray is one with at
least one dimension equal to zero. For example, a double-precision
mxArray of
type
double, where m and n equal 0 and pr is NULL, is an empty array.
Using Data Types
The six fundamental data types in MATLAB are double, char, sparse, uint8,
cell, and struct. You can write MEX-files, MAT-file applications, and engine
applications in C that accept any data type supported by MATLAB. In Fortran,
only the creation of double-precision n-by-m arrays and strings are supported.
You can treat C and Fortran MEX-files, once compiled, exactly like
M-functions.
The explore Example
There is an example MEX-file included with MATLAB, called explore, that
identifies the data type of an input variable. The source file for this example is
in the
<matlab>/extern/examples/mex directory, where <matlab> represents
the top-level directory where MATLAB is installed on your system. For
example, typing
cd([matlabroot '/extern/examples/mex']);
x = 2;
explore(x);
produces this result
------------------------------------------------
Name: x
Dimensions: 1x1
Class Name: double
------------------------------------------------
(1,1) = 2