rescale
更改 fi 对象的定标
语法
b = rescale(a, fractionlength) b = rescale(a, slope, bias) b = rescale(a, slopeadjustmentfactor, fixedexponent, bias) b = rescale(a, ..., PropertyName, PropertyValue, ...)
说明
rescale 函数的作用类似于 fi 复制函数,但有以下例外:
fi复制构造函数保留真实值,而rescale保留存储整数值。rescale不允许更改Signed和WordLength属性。
示例
在以下示例中,fi 对象 a 经过重新定标以创建 fi 对象 b。a 和 b 的真实值不同,但它们的存储整数值相同:
p = fipref('FimathDisplay','none',... 'NumericTypeDisplay','short'); a = fi(10, 1, 8, 3)
a =
10
numerictype(1,8,3)b = rescale(a,1)
b =
40
numerictype(1,8,1)stored_integer_a = storedInteger(a); stored_integer_b = storedInteger(b); isequal(stored_integer_a,stored_integer_b)
ans = logical 1
扩展功能
版本历史记录
在 R2006a 之前推出