【发布时间】:2018-07-19 08:08:41
【问题描述】:
我有一组整数值,例如:
V = [26767559, 6022443, 9923637]; % etc.
对于我的应用来说,方便的表示为<rounded_mantissa>E5(即some_val*105),所以对于上面的例子我想得到:
N = ["268E5", "60E5", "99E5"]; % I won't mind if it's E+05
目前,我正在使用几种可能的解决方法之一来实现此输出,
N = round(V*1E-5) + "E5";
但我想知道是否可以指定 formatSpec 的 sprintf、num2str(等等),这样它会输出具有特定指数值的数字(在这种情况下,@ 987654328@),不执行除法(如num2str(round(V/1E5).','%3uE5'))。
我正在使用 R2018a。
【问题讨论】:
标签: matlab printf exponential notation format-specifiers