how can i change data type of any variable

10 ビュー (過去 30 日間)
ablaze
ablaze 2017 年 3 月 29 日
編集済み: Stephen23 2017 年 3 月 29 日
how can i change data type of any variable. i am using R2012a matlab. because by default its taking every value as a decimal.
  1 件のコメント
Stephen23
Stephen23 2017 年 3 月 29 日
編集済み: Stephen23 2017 年 3 月 29 日
"decimal" is not a MATLAB data type:
"how can i change data type of any variable"
By reading the documentation, and doing the introductory tutorials:

サインインしてコメントする。

回答 (1 件)

Jan
Jan 2017 年 3 月 29 日
The default type used by Matlab is double (not "decimal"). You cannot change the default type, but you can easily specify a different type for a variable:
a = uint8(17)
But with
b = 17
the type of b is double.

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by