1.? set(handles.xxx,'String',num2str(x,'%6.3f'));? %xxx處為該編輯框tag,x為某數值變量,
'%6.3f'中的.3表示小數點後位數。具體可參見fprintf函數的幫助。
2.?num2str的幫助中有說明當變量為浮點數時將被轉為4位精度的值。如下
“str?=?num2str(A)?converts?array?A?into?a?string?representation?str.?Converted?floating-point?values?have?a?maximum?of?four?digits?of?precision,?and?an?exponent?if?required.?For?integer?values,?num2str?returns?the?exact?string?representation?of?the?value.”