當前位置:編程學習大全網 - 電腦編程 - matlab GUI怎樣控制輸出結果的精度?

matlab GUI怎樣控制輸出結果的精度?

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.”

  • 上一篇:a block device file 指的是什麽?
  • 下一篇:手機撥打69顯示搜索運行代碼怎麽回事
  • copyright 2024編程學習大全網