12.07.2015 Views

Matlab/Octave Tutorial

Matlab/Octave Tutorial

Matlab/Octave Tutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MATLAB 程 式 設 計 入 門 篇 : 初 探 MATLAB不 同 資 料 的 儲 存• 我 們 要 節 省 記 憶 體 空 間 , 可 以 依 矩 陣 元 素 值 的 範 圍 , 選 用 不 同 的 資 料 來儲 存• 範 例 9-23: datatype01.mclear allx_double = magic(10);x_single = single(x_double);x32 = uint32(x_double);x16 = uint16(x_double);x8 = uint8(x_double);whos% 清 除 所 有 工 作 空 間 的 變 數Name Size Bytes Classx16 10x10 200 uint16 arrayx32 10x10 400 uint32 arrayx8 10x10 100 uint8 arrayx_double 10x10 800 double arrayx_single 10x10 400 single arrayGrand total is 500 elements using 1900 bytes• uint8 來 儲 存 變 數 所 佔 的 空 間 只 有 double 的 八 分 之 一 !87

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!