查看双值时出现问题
我在 matlab 控制台中查看双数据时遇到问题。实际上,我正在从数据文件中导入矩阵。特定行和列的值为 1.543
但在控制台中,当我使用 disp(x)
时,其中 x
是导入的矩阵,它显示为 1.0e+03 * 0.0002
。但是,当我尝试使用 disp(x(25,25))
访问矩阵中的特定元素时,其中 25
和 25
是显示的行号和列号为 1.543
。所以我很困惑。任何澄清。只是当我打印整个矩阵时,它显示为 1.0e+03 * 0.0002 。
I am having an issue with viewing double data in matlab console. Actually, I am importing a matrix from my data file. The value of a particular row and column was 1.543
but in the console when I use disp(x)
where x
is the matrix imported, it is showing as 1.0e+03 * 0.0002
. However, when I try to access that particular element in the matrix using disp(x(25,25))
where 25
and 25
are the row and column numbers it is showing to be 1.543
. So I am confused. Any clarifications. It is just that when I print the whole matrix it is showing as 1.0e+03 * 0.0002
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下命令应该修复它。这只是一个显示问题,矩阵中实际值的精度不受影响:
The following command should fix it. It is only a display issue, the precision of the actual values in the matrix are not affected:
发生这种情况是由于数据的高动态范围。
尝试例如:
结果是:
第一个值看起来好像为零,但事实并非如此。与第二个相比,几乎为零。这并不奇怪。尝试将大值与小值相加,然后减去,结果为零。这是由于浮点运算所致。以下表达式为
true
可以做什么?
1) 非常高的动态范围可能会导致任何类型的计算出现问题。尝试了解问题从何而来,并在更广泛的背景下解决问题。
2)。您可以尝试设置
它可以在某些情况下视觉上改善情况。
That happens due to high dynamic range of your data.
Try for example :
The result is:
It looks like the first value is zero, but it isn't. It is almost zero compared to the second one. That is not surprising. Try to add to the big value the small one, and subtract, and you get zero. That is due to floating point arithmetic.The following expression is
true
What can be done?
1) A really high dynamic range can cause troubles in any kind of computations. Try to understand where it came from, and solve the problem in a broader context.
2). You can try to set
It can improve the situation visually for some of the cases.