2013-10-17 5 views
1

즉 16 개의 소수 비트를 갖는 부호있는 32 비트 번호 : I 작성 어떻게타입의 변수를 생성 matlab에 fixdt 매트랩 임의의 고정 소수점 데이터 유형을 생성하기 쉽게되는 고정 소수점 라이센스

custom_sfix = fixdt(1,32,16) 

custom_sfix = 

Simulink.NumericType 
    DataTypeMode: 'Fixed-point: binary point scaling' 
     Signedness: 'Signed' 
     WordLength: 32 
    FractionLength: 16 
     IsAlias: false 
     DataScope: 'Auto' 
     HeaderFile: '' 
    Description: '' 

matlab에이 유형의 가치?

유형에 내장 들어 그냥 a = int8(5); 또는 a = uint32(45); 이다 나는 또한 유형 캐스트 ​​시도했다, 그러나 이것은 단지 데이터 유형에 내장을 받아 들일 것으로 보인다.

>> Y = typecast(12.5, custom_sfix) 
Error using typecast 
The second input argument must be a character array. 

>> Y = typecast(12.5, 'fixdt(1,32,16)') 
Error using typecast 
Unsupported class. 

답변