主要内容

isslopebiasscaled

确定 numerictype 对象是否具有非平凡斜率和偏置定标

说明

numerictype T 具有非平凡斜率和偏置定标时,tf = isslopebiasscaled(T) 返回 1 (true)。否则,返回 0 (false)。当斜率为 2 的整数次幂且偏置为 0 时,斜率和偏置定标是平凡的。

示例

示例

全部折叠

创建一个 numerictype 对象并确定它是否具有非平凡斜率和偏置定标。

T1 = numerictype
T1 =


          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 15
tf = isslopebiasscaled(T1)
tf = logical
   0

T2 = numerictype('DataTypeMode',...
    'Fixed-point: slope and bias scaling',...
    'WordLength',32,...
    'Slope',2^-2,...
    'Bias',4)
T2 =


          DataTypeMode: Fixed-point: slope and bias scaling
            Signedness: Signed
            WordLength: 32
                 Slope: 0.25
                  Bias: 4
tf = isslopebiasscaled(T2)
tf = logical
   1

T3 = numerictype('DataTypeMode',...
    'Fixed-point: slope and bias scaling',...
    'WordLength',32,...
    'Slope',2^2,...
    'Bias',0)
T3 =


          DataTypeMode: Fixed-point: slope and bias scaling
            Signedness: Signed
            WordLength: 32
                 Slope: 2^2
                  Bias: 0
tf = isslopebiasscaled(T3)
tf = logical
   0

输入参数

全部折叠

输入 numerictype 对象,指定为标量。

版本历史记录

在 R2008a 中推出