在matlab计算过程中保留小数点后5位,是什么意思?咋么实现?
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/10 23:36:01
在matlab计算过程中保留小数点后5位,是什么意思?咋么实现?
在matlab计算过程中保留小数点后5位,是什么意思?是每次计算的结果显示出小数点后5位?还是每次迭代都保留到前5位再进行迭代?
如何实现呢?默认是4位呀
在matlab计算过程中保留小数点后5位,是什么意思?是每次计算的结果显示出小数点后5位?还是每次迭代都保留到前5位再进行迭代?
如何实现呢?默认是4位呀
比如你的结果是n,
n = roundn(n,-5);
这样结果就是5位小数了.
你直接在command window上输入n时看不到第五位的.
fprintf('%d',n);
看一下就可以看到了.
或者你可以在workspace里看到.
再问: 你说的不行呀 >> n=10.230409; >> roundn(n,-5) ans = 10.230409999999999
再答: 那个就是1,你在workspace里打开看一下。点进去看里面的值。 roundn Round to multiple of 10n Syntax roundn(x,n) Description roundn(x,n) rounds each element of x to the nearest multiple of 10n. n must be scalar, and integer-valued. For complex x, the imaginary and real parts are rounded independently. For n = 0, roundn gives the same result as round. That is, roundn(x,0) == round(x). Examples Round pi to the nearest hundredth. roundn(pi, -2) ans = 3.1400 这是matlab对于roundn的解释。
n = roundn(n,-5);
这样结果就是5位小数了.
你直接在command window上输入n时看不到第五位的.
fprintf('%d',n);
看一下就可以看到了.
或者你可以在workspace里看到.
再问: 你说的不行呀 >> n=10.230409; >> roundn(n,-5) ans = 10.230409999999999
再答: 那个就是1,你在workspace里打开看一下。点进去看里面的值。 roundn Round to multiple of 10n Syntax roundn(x,n) Description roundn(x,n) rounds each element of x to the nearest multiple of 10n. n must be scalar, and integer-valued. For complex x, the imaginary and real parts are rounded independently. For n = 0, roundn gives the same result as round. That is, roundn(x,0) == round(x). Examples Round pi to the nearest hundredth. roundn(pi, -2) ans = 3.1400 这是matlab对于roundn的解释。
在matlab计算过程中保留小数点后5位,是什么意思?咋么实现?
计算结果保留小数点后两位数是计算过程中就开始保留两位还是计算最后一步结果时才保留两位
在EXCEL表格中如何实现数字后加上竖线,并且数字保留小数点后2位?
化学在计算中没有整除小数点后保留几位?
matlab 用num2str函数如何保留小数点后10位
化学计算题在计算过程中小数点怎么取舍,保留有效数字和保留几位小数怎么看呢?
Excel公式计算时怎么保留小数点后2位
excel 函数计算怎么保留小数点后2位阿?
在excel中如何在小数点后保留2位小数?
在Excel中怎么设置保留小数点的位数,比如保留5位怎么设置
怎么样能在Excel2003里单元格中输入小数点后保留两位的数字
物理中小数点后通常保留几位小数?