Programming Previous page   Next Page

Data Types


There are many different types of data that you can work with in MATLAB. You can build matrices and arrays of floating-point and integer data, characters and strings, logical true and false states, etc. You can also develop your own data types using MATLAB classes. Two of the MATLAB data types, structures and cell arrays, provide a way to store dissimilar types of data in the same array. This chapter describes each of these data types and how to use them in your MATLAB programming.

Overview of MATLAB Data Types
Brief description of all MATLAB data types
Numeric Types
Integer and floating-point data types, complex numbers, NaN, infinity, and numeric display format
Logical Types
States of true and false, use of logicals in conditional statements and logical indexing, logical/numeric conversion
Characters and Strings
Characters, strings, cell arrays of strings, string comparison, search and replace, character/numeric conversion
Dates and Times
Date strings, serial date numbers, date vectors, date type conversion, output display format
Structures
C-like structures with named fields, dynamic field names, adding and removing fields
Cell Arrays
Arrays of cells containing different data types and shapes, using cell arrays in argument lists, numeric/cell conversion
Function Handles
Passing function access data to other functions, extending function scope, extending the lifetime of variables
MATLAB Classes
Object-oriented classes and methods using MATLAB classes, creating your own MATLAB data types
Java Classes
Working with Java classes within MATLAB using the MATLAB interface to the Java programming language


Previous page  Summary of Matrix and Array Functions Overview of MATLAB Data Types Next page

© 1994-2005 The MathWorks, Inc.