matlab - 在 MATLAB 的变量编辑器中更改十进制数

标签 matlab double decimal

假设我们有这样的代码:

a = pi;
b = pi+2;
c = pi*2.2
out = [a b c] 

返回:

out =

    3.1416    5.1416    6.9115

我想要这个输出(没有四舍五入到小数点后两位):

out =

    3.14    5.14    6.91

我不想打印这些值。我想在这里看到他们有两位小数: enter image description here

最佳答案

使用 format bank 显示 2 位小数。关于 documentation 中的 format 函数的更多详细信息.

如果您想更改变量在变量编辑器中的显示方式,请查看 this page of the documentation .

enter image description here

enter image description here

关于matlab - 在 MATLAB 的变量编辑器中更改十进制数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30096734/

相关文章:

python math.log 在较大的 int 下输出不准确?

c# - 将 Double 变量转换为 Decimal

matlab - 如何确定函数调用的输出是否未使用?

python - 在 matlab 中运行 python 代码?

c# - 用数字保证精度?

wpf - 如何在 XAML、WPF 中四舍五入?

c# - 小数点使用逗号,千位 rdlc 报告使用句点

image - 正确理解不正确的MATLAB运算

matlab - 如何从另一个程序访问 MATLAB(插值)样条曲线?

asp.net-mvc - 模型绑定(bind)程序无法处理 double.MAX 字符串表示形式返回 double