在matlab计算过程中保留小数点后5位,是什么意思?咋么实现?
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/08/11 14:24:06
在matlab计算过程中保留小数点后5位,是什么意思?咋么实现?
在matlab计算过程中保留小数点后5位,是什么意思?是每次计算的结果显示出小数点后5位?还是每次迭代都保留到前5位再进行迭代?
如何实现呢?默认是4位呀
在matlab计算过程中保留小数点后5位,是什么意思?是每次计算的结果显示出小数点后5位?还是每次迭代都保留到前5位再进行迭代?
如何实现呢?默认是4位呀
![在matlab计算过程中保留小数点后5位,是什么意思?咋么实现?](/uploads/image/z/1442542-22-2.jpg?t=%E5%9C%A8matlab%E8%AE%A1%E7%AE%97%E8%BF%87%E7%A8%8B%E4%B8%AD%E4%BF%9D%E7%95%99%E5%B0%8F%E6%95%B0%E7%82%B9%E5%90%8E5%E4%BD%8D%2C%E6%98%AF%E4%BB%80%E4%B9%88%E6%84%8F%E6%80%9D%3F%E5%92%8B%E4%B9%88%E5%AE%9E%E7%8E%B0%3F)
比如你的结果是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里单元格中输入小数点后保留两位的数字
物理中小数点后通常保留几位小数?