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!