MATLAB:如何显示"真正的"一个数组的值? [英] Matlab: how to display the "real" values of an array?

查看:406
本文介绍了MATLAB:如何显示"真正的"一个数组的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在脚本caluculated向量。

I have a vector that is caluculated in a script.

经过计算,我的显示值命令窗口。它显示如下:

After calculation, I display the values to the command window. It is displayed as follows:

finalResults =
1.0e+05 *
0.0001
     0
0.0005
0.0002
0.0001
0.0027
0.0033
0.0001
-0.0000
-0.0000
1.3750
0.0066

我如何使其与的真正的值显示(即与 1.0E + 05 相乘)?

How do I make it display with the real values (i.e. with the 1.0e+05 multiplied in)?

推荐答案

格式longG 应该做的伎俩。这无论是使用 LONGE 两者中较短的的每个元素的。同样可以做到格式shortG 如果你想要更短的序列。

format longG should do the trick. This used either long or longE, whichever is shorter for each element. Same can be done with format shortG if you want shorter sequences.

原因MATLAB显示像你的问题,是因为这是格式做事的短办法。看看 格式德文档,看看所有选项。

The reason MATLAB displays like in your question, is because this is the format short way of doing things. Look at format in de documentation to see all the options.

例如:

format shortG
A = [1;1e10;-1];
A =

            1
        1e+10
           -1
format longG
A =

                         1
               10000000000
                        -1

这篇关于MATLAB:如何显示"真正的"一个数组的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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