12.07.2015 Views

Matlab/Octave Tutorial

Matlab/Octave Tutorial

Matlab/Octave Tutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MATLAB 程 式 設 計 入 門 篇 : 初 探 MATLAB資 料 儲 存 的 注 意 事 項• 整 數 資 料 型 態 的 範 圍 有 限 , 若 超 過 此 範 圍 , 則 超 出 部 分 將 會 被 「 裁 掉 」>> uint8(300) % uint8 的 最 大 值 為 255ans =255>> int8(-500) % int8 的 最 小 值 為 -128ans =-128• 整 數 資 料 型 態 可 以 比 較 大 小 , 但 不 可 直 接 進 行 數 學 運 算>> uint8(20)== 20 % 可 比 較 大 小ans =1>> uint8(20)-20 % 無 法 進 行 數 學 運 算??? Error using ==> -Function '-' not defined for variables of class 'uint8'.• 若 要 進 行 數 學 運 算 , 需 先 用 double 指 令 將 之 轉 成 雙 精 準 浮 點 數 才 能 進 行88

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

Saved successfully!

Ooh no, something went wrong!