如何在 MATLAB 中的数组中存储 4 个以上的小数位 [英] How to store more than 4 decimal places in an array in MATLAB

查看:80
本文介绍了如何在 MATLAB 中的数组中存储 4 个以上的小数位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 6 个十进制数字存储到一个数组中,但是当我将它存储到一个数组中时,它最多只能存储 4 个十进制数字而不是 6 个.如何将最多 6 个数字存储到一个数组中?

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?

例如,如果

 e=0.059995;
 W(l,i)=e;

但是 W(l,i) 给了我 4 个小数位的结果

but W(l,i) gives me the result as 4 decimal places

 disp(W(l,i))
  0.0600

如何将 6 个十进制数字存储到一个数组中,即当我打印它打印的数组时6位小数?

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

有人可以帮我吗?

推荐答案

默认设置下的 Matlab 最多可存储 15 位数字.它只是您的显示格式.看看 format 命令.

Matlab on default settings stores up to 15 digits. It only your display format. Have a look at the format command.

或者直接在 Matlab 命令提示符下输入:

Or just type at the Matlab command prompt:

format long

这篇关于如何在 MATLAB 中的数组中存储 4 个以上的小数位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆