フィルターのクリア

save one matrix to another but with different precision

2 ビュー (過去 30 日間)
Daniel Barzegar
Daniel Barzegar 2014 年 6 月 25 日
回答済み: James Tursa 2014 年 6 月 25 日
Hi all, i have a matrix which includes float numbers and i want to save it into a new one, but in the new matrix i want to have more digits (compared to the 1st matrix) after the dot - precision.
Any ideas?

回答 (1 件)

James Tursa
James Tursa 2014 年 6 月 25 日
MATLAB supports IEEE 64-bit double precision floating point numbers (the default for constant numeric) and IEEE 32-bit single precision floating point numbers. They are displayed on your screen according to the current display option in effect, but the display does not affect the underlying numbers themselves. If you want to increase the number of digits displayed, you can type this at the command prompt:
format long
If you want to go back to fewer digits printed, you can type this:
format short
If you actually want to increase the precision of the underlying numbers, you will need to use something other than double or single. E.g., vpa from the Symbolic Toolbox, or HPF from John D'Errico:

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by