MATLAB Function Reference Previous page   Next Page

Convert to single-precision



B = single(A) converts the matrix A to single precision, returning that value in B. A can be any numeric object (such as a double). If A is already single precision, single has no effect. Single-precision quantities require less storage than double-precision quantities, but have less precision and a smaller range.

The single class is primarily meant to be used to store single-precision values. Hence most operations that manipulate arrays without changing their elements are defined. Examples are reshape, size, the relational operators, subscripted assignment, and subscripted reference.

You can define your own methods for the single class by placing the appropriately named method in an @single directory within a directory on your path.


See Also


Previous page  sind  sinh Next page

© 1994-2005 The MathWorks, Inc.