Main Content

tostring

fifimathnumerictypequantizer 对象转换为字符串

说明

示例

s = tostring(a)fi 对象 a 转换为字符向量 s,这样 eval(s) 将创建与 a 具有相同属性的 fi 对象。

示例

s = tostring(F)fimath 对象 F 转换为字符向量 s,这样 eval(s) 将创建与 F 具有相同属性的 fimath 对象。

示例

s = tostring(T)numerictype 对象 T 转换为字符向量 s,这样 eval(s) 将创建与 T 具有相同属性的 numerictype 对象。

示例

s = tostring(q)quantizer 对象 q 转换为字符向量 s,这样 eval(s) 将创建与 q 具有相同属性的 quantizer 对象。

示例

全部折叠

a = fi(pi,1,16,10);
s = tostring(a)
a1 = eval(s)
isequal(a,a1)
s =

    'fi('numerictype',numerictype(1,16,10),'Value','3.1416015625')'


a1 = 

    3.1416

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 10

ans =

  logical

   1
F = fimath('OverflowAction','Saturate','RoundingMethod','Convergent');
s = tostring(F)
F1 = eval(s)
isequal(F,F1)
s =

    'fimath('RoundingMethod', 'Convergent',...
     'OverflowAction', 'Saturate',...
     'ProductMode','FullPrecision',...
     'SumMode','FullPrecision')'


F1 = 


        RoundingMethod: Convergent
        OverflowAction: Saturate
           ProductMode: FullPrecision
               SumMode: FullPrecision

ans =

  logical

   1
T = numerictype(1,16,15);
s = tostring(T)
T1 = eval(s)
isequal(T,T1)
s =

    'numerictype(1,16,15)'


T1 =


          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 15

ans =

  logical

   1
q = quantizer('fixed','Ceiling','Saturate',[5 4]);
s = tostring(q)
q1 = eval(s)
isequal(q,q1)
s =

    'quantizer('fixed', 'ceil', 'saturate', [5  4])'


q1 =


        DataMode = fixed
       RoundMode = ceil
    OverflowMode = saturate
          Format = [5  4]

ans =

  logical

   1

输入参数

全部折叠

输入 fi 对象。

数据类型: fi
复数支持:

输入 fimath 对象。

输入 numerictype 对象。

输入 quantizer 对象。

版本历史记录

在 R2006a 之前推出

另请参阅

| | | |