在MATLAB中如何在一个数组中保存4位以上的小数位 [英] How to store more than 4 decimal places in an array in MATLAB
问题描述
我想将6个十进制数字存储到一个数组中,但是当它存储到数组中时,它只能存储最多4个十进制数字,而不是6个。如何将最多6个数字存储到数组中? b
$ b
例如,如果
e = 0.059995;
W(l,i)= e;
但W(l,i)给出的结果为4位小数
disp(W(l,i))
0.0600
如何将6个十进制数字存储到数组中,即当我打印数组时,它打印
小数点后6位?
disp(W(l,i))
0.059995
任何人都可以帮助我吗?
Matlab默认设置最多可存储15位数字。它只是你的显示格式。看看 格式
命令。
或者只需在Matlab命令提示下键入:
格式长
I want to store 6 decimal digits into an array, but when I store it into array it only stores up to 4 decimal digits instead of 6. How can I store up to 6 digits into an array?
For example, if
e=0.059995;
W(l,i)=e;
but W(l,i) gives me the result as 4 decimal places
disp(W(l,i))
0.0600
How can I store 6 decimal digits into an array, i.e when I print the array it prints 6 decimal places?
disp(W(l,i))
0.059995
Can anyone help me?
Matlab on default settings stores up to 15 digits. It only your display format. Have a look at the format
command.
Or just type at the Matlab command prompt:
format long
这篇关于在MATLAB中如何在一个数组中保存4位以上的小数位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!