如何在matlab中删除十进制尾随零

时间:2014-06-05 19:47:54

标签: matlab number-formatting

如何在matlab中删除矩阵(C)中的十进制尾随零。

  65.7500    4.7500    4.7500   64.0000   60.0000   
  118.9000  105.6000   92.5500  147.6000  178.2000 
   73.6600   84.0100   95.6900  190.0000  164.0000  
  147.9000  132.0000  140.0000  147.0000  116.5000  

ans =

  65.75    4.75    4.75   64      60   
  118.9   105.6    92.55  147.6  178.2
   73.66   84.01   95.69  190    164 
  147.9    132     140    147    116.5 

1 个答案:

答案 0 :(得分:8)

>> format short g
>> C
C =
        65.75         4.75         4.75           64           60
        118.9        105.6        92.55        147.6        178.2
        73.66        84.01        95.69          190          164
        147.9          132          140          147        116.5