在命令窗口中执行format short表示保留4位小数,执行format long对双精度浮点保留15位小数,对单精度浮点数保留7为小数。 clc format short a1=pi format long a1