-
matlab 不保存为科学计数法 http://blog.sciencenet.cn/blog-472136-402727.html
经常在表示matlab值时,它总会把一些小于1的大于1000的数使用科学计数法表示。这有时让人看了很不爽,每次把数据写到文本文件中也是很恶。
所以每次查来查去,这次解决是这样解决的。
1)、前面设置format g;
2)、使用fprintf设置格式为%g。
- matlab专区--------------matlab里面如何保留小数特定位数 http://blog.csdn.net/yf210yf/article/details/7235907
二、在小数点后某一位四舍五入,即保留几位小数,也经常用到。
1.数值型 roundn—任意位位置四舍五入
>>a=123.4567890;
>>a=roundn(a,-4)
a = 123.4568
其中roundn函数功能如下:
y = ROUNDN(x) rounds the input data x to the neares