9-4 ��������������������������?

@x}ƫAOw] double]ǯBIơ^Ab MATLAB 5.3 A]䴩PתƻPBIƸƺAAzpUG

O
uint8 ഫatB 8 줸ơAȰ쬰 $[0, 2^{8}-1]=[0,255]$
uint16 ഫatB16 줸ơAȰ쬰 $[0, 2^{16}-1]=[0,65535]$
uint32 ഫatB32 줸ơAȰ쬰 $[0, 2^{32}-1]$
int8 ഫatB 8 줸ơAȰ쬰 $[-2^{7}, 2^{7}-1]=[-128,127]$
int16 ഫat B 16 줸ơAȰ쬰 $[-2^{15}, 2^{15}-1]=[-32768,32767]$
int32 ഫat B 32 줸ơAȰ쬰 $[-2^{31}, 2^{31}-1]$
single ഫ single]ǯBIơ^A 32 줸]4 bytes^
double ഫdouble ]ǯBIơ^A 64 줸]8 bytes^
char ഫrΦrACӦrΡ]16 줸^]2 bytes^

]ApGڭ̭n`ٰOŶANiH̯x}ȪdAΤPƨxsAҦpG

Example 1: 09-x}BzPB/dataType01.mclear all % MҦu@Ŷܼ x_double = magic(10); x_single = single(x_double); x32 = uint32(x_double); x16 = uint16(x_double); x8 = uint8(x_double); whos Name Size Bytes Class Attributes x16 10x10 200 uint16 x32 10x10 400 uint32 x8 10x10 100 uint8 x_double 10x10 800 double x_single 10x10 400 single

ѤWiAϥ uint8 xsܼƩҦŶu double K@COn`NOGƸƫAd򦳭AYWLdAhWXN|QuvAҦpG

Example 2: 09-x}BzPB/dataTypeRange01.mfprintf('uint8(300) ='); disp(uint8(300)); % uint8 ̤jȬ 255 fprintf('int8(-500) ='); disp(int8(-500)); % int8 ̤pȬ -128uint8(300) = 255 int8(-500) = -128


MATLAB{]pGJg