主要内容

isscalingslopebias

确定输入是否具有非平凡斜率和偏置定标

说明

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

示例

numerictype 对象 T 具有非平凡斜率和偏置定标时,tf = isscalingslopebias(T) 返回 1 (true)。否则,返回 0 (false)。

示例

示例

全部折叠

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

a = fi(pi)
a = 
    3.1416

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 13
tf = isscalingslopebias(a)
tf = logical
   0

b = fi(pi,1,16,3,1)
b = 
     4

          DataTypeMode: Fixed-point: slope and bias scaling
            Signedness: Signed
            WordLength: 16
                 Slope: 3
                  Bias: 1
tf = isscalingslopebias(b)
tf = logical
   1

如果 fi 对象具有平凡斜率和偏置定标,即斜率为 2 的整数次幂且偏置为零,则 isscalingslopebias 返回 0

c = fi(pi,1,16,4,0)
c = 
     4

          DataTypeMode: Fixed-point: slope and bias scaling
            Signedness: Signed
            WordLength: 16
                 Slope: 2^2
                  Bias: 0
tf = isscalingslopebias(c)
tf = logical
   0

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

T = numerictype
T =


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

输入参数

全部折叠

输入 fi 对象,指定为标量、向量、矩阵或多维数组。

数据类型: fi

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

版本历史记录

在 R2010b 中推出