What is the standard type of operations in MATLAB?

1 次查看(过去 30 天)
I was wondering what the standard type in MATLAB operations is, i.e. single or double. I guess it is double. But how can I change the operations like e.g. eig() into single precision operations? Is it enough to specify the input argument as a single presision input argument or is there something elese. I was wondering because e.g. for the function zeros() or ones() I have to specify 'single' or 'double'.
Or is there a way to tell MATLAB to do EVERYTHING in single precision?

采纳的回答

Stephen23
Stephen23 2016-7-5
编辑:Stephen23 2016-7-5
From the numeric data types documentation: "By default, MATLAB stores all numeric values as double-precision floating point". It is not possible to change the default data type globally.
However operations are a different matter entirely... The MATLAB documentation does not say what number format is used for intermediate values in functions like eig. It is likely to be double, or even higher precision through the use of guard digits. Note that many numeric operations, such as eig, are provided by the libraries upon which MATLAB is based, such as LAPACK (earlier used EISPACK and LINPACK), and so the algorithm used in those libraries defines the result that MATLAB returns.

更多回答(1 个)

José-Luis
José-Luis 2016-7-5
编辑:José-Luis 2016-7-5
Default is double indeed.
To answer your last question: In a nutshell, no.

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by