Is it possible in matlab to explicitly format the output numbers?

前端 未结 7 1966
太阳男子
太阳男子 2020-12-02 02:07

I know about MATLAB\'s format long, format short, eng ... and so on. But short and long will always display a predefined number of decimals, with

7条回答
  •  生来不讨喜
    2020-12-02 03:06

    I don't know of a way to specify a global format of the type you want. sprintf('%15.4f', x) or num2str(x, '%15.4f') do what you're looking for, if you don't mind calling them explicitly each time.

提交回复
热议问题