how can i change data type of any variable

조회 수: 17 (최근 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 CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by