What is the standard type of operations in MATLAB?

1 回表示 (過去 30 日間)
Urs Waldmann
Urs Waldmann 2016 年 7 月 5 日
編集済み: Stephen23 2016 年 7 月 5 日
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 Center および File ExchangeFourier Analysis and Filtering についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by