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?
0 件のコメント
採用された回答
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.
You should definitely read this paper: What Every Computer Scientist Should Know About Floating-Point Arithmetic, by David Goldberg.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Fourier Analysis and Filtering についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!