Main Content

tfdata

Access transfer function data

    Description

    example

    [num,den] = tfdata(sys)returns the numerator and denominator coefficients of the transfer function for thetf,ssandzpkmodel objects or the array of model objects represented bysys.

    The outputsnumanddenare two-dimensional cell arrays ifsyscontains a single LTI model. Whensysis an array of models,numanddenare returned as multidimensional cell arrays.

    example

    [num,den,ts] = tfdata(sys)also returns the sample timets.

    example

    [num,den,ts,sdnum,sdden] = tfdata(sys)also returns the uncertainties in the numerator and denominator coefficients of identified systemsys.sdnum{i,j}(k)is the 1 standard uncertainty in the valuenum{i,j}(k)andsdden{i,j}(k)is the 1 standard uncertainty in the valueden{i,j}(k). Ifsysdoes not contain uncertainty information,sdnumandsddenare empty[].

    example

    ___= tfdata(sys,J1,...,JN)extracts the data for theJ1,...,JNentry in the model arraysys.

    example

    [num,den] = tfdata(sys, ' v ')returns the numerator and denominator coefficients as row vectors rather than cell arrays for a SISO transfer function represented bysys.

    Examples

    collapse all

    For this example, considertfData.matwhich contains a continuous-time SISO transfer functionsys1.

    Load the data and usetfdata提取the numerator and denominator coefficients.

    load('tfData.mat','sys1'); [num,den] = tfdata(sys1);

    numanddenare returned as cell arrays. To display data, usecelldisp.

    celldisp(num)
    num{1} = 0 1 5 2
    celldisp(den)
    den{1} = 7 4 2 1

    You can also extract the numerator and denominator coefficients as row vectors with the following syntax.

    [num,den] = tfdata(sys1,'v');

    For this example, considertfData.matwhich contains a discrete-time SISO transfer functionsys2.

    Load the data and usetfdata提取the numerator and denominator coefficients along with the sample time.

    load('tfData.mat','sys2'); [num,den,ts] = tfdata(sys2)
    num =1x1 cell array{[0 0 2 0]}
    den =1x1 cell array{[4 0 3 -1]}
    t = 0.1000

    numanddenare returned as cell arrays. To display data, usecelldisp.

    celldisp(num)
    num{1} = 0 0 2 0
    celldisp(den)
    den{1} = 4 0 3 -1

    For this example, estimate a transfer function with 2 poles and 1 zero from identified data contained iniddata7.matwith an input delay value.

    Load the identified data and estimate the transfer function.

    load('iddata7.mat'); sys = tfest(z7,2,1,“InputDelay',[1 0]);

    Extract the numerator, denominator and their standard deviations for the 2-input, 1 output identified transfer function.

    [num,den,~,sdnum,sdden] = tfdata(sys)
    num=1×2 cell array{[0 -0.5212 1.1886]} {[0 0.0552 -0.0013]}
    den=1×2 cell array{[1 0.3390 0.2353]} {[1 0.0360 0.0314]}
    sdnum=1×2 cell array{[0 0.1311 0.0494]} {[0 0.0246 0.0033]}
    sdden=1×2 cell array{[0 0.0183 0.0085]} {[0 0.0278 0.0048]}

    For this example, extract numerator and denominator coefficients for a specific transfer function contained in the 3x1 array of continuous-time transfer functionssys.

    Load the data and extract the numerator and denominator coefficients of the second model in the array.

    load('tfArray.mat','sys'); [num,den] = tfdata(sys,2);

    Use celldisp to visualize the data in the cell arraynumandden.

    celldisp(num)
    num{1} = 0 0 2
    celldisp(den)
    den{1} = 1 1 2

    Input Arguments

    collapse all

    Dynamic system, specified as a SISO or MIMO dynamic system model, or an array of SISO or MIMO dynamic system models. Dynamic systems that you can use include continuous-time or discrete-time numeric LTI models such astf,ssandzpkmodels.

    Ifsysis a state-space or zero-pole-gain model, it is first converted to transfer function form usingtf. For more information on the format of transfer function model data, see thetfreference page.

    For SISO transfer functions, use the following syntax to return the numerator and denominator coefficients directly as row vectors rather than as cell arrays:

    [num,den] = tfdata(sys,'v')

    Indices of models in array whose data you want to access, specified as a positive integer. You can provide as many indices as there are array dimensions insys. For example, ifsysis a 4-by-5 array of transfer functions, the following command accesses the data for entry (2,3) in the array.

    [num,den] = tfdata(sys,2,3);

    Output Arguments

    collapse all

    Coefficients of the numerator of the transfer function, returned as a cell array or row vector.

    Whensyscontains a single LTI model, the outputnumis returned as a cell array with the following characteristics:

    • numhas as many rows as outputs and as many columns as inputs ofsys.

    • The(i,j)entries innum{i,j}are row vectors specifying the numerator coefficients of the transfer function from inputjto outputi.tfdataorders these coefficients indescendingpowers ofsorz.

    Whensyscontains an array of LTI models,numis returned as a multidimensional cell array of the same size assys.

    Coefficients of the denominator of the transfer function, returned as a cell array or row vector.

    Whensyscontains a single LTI model, the outputdenis returned as a cell array with the following characteristics:

    • denhas as many rows as outputs and as many columns as inputs ofsys.

    • The(i,j)entries inden{i,j}are row vectors specifying the denominator coefficients of the transfer function from inputjto outputi.tfdataorders these coefficients indescendingpowers ofsorz.

    Whensyscontains an array of LTI models,denis returned as a multidimensional cell array of the same size assys.

    Sample time, returned as a non-negative scalar.

    Standard uncertainty of the numerator coefficients of the identified systemsys, returned as a cell array of the same size asnum.sdnum{i,j}(k)is the 1 standard uncertainty in the valuenum{i,j}(k). Ifsysdoes not contain uncertainty information,sdnumis empty[].

    Standard uncertainty of the denominator coefficients of the identified systemsys, returned as a cell array of the same size asden.sdden{i,j}(k)is the 1 standard uncertainty in the valueden{i,j}(k). Ifsysdoes not contain uncertainty information,sddenis empty[].

    Version History

    Introduced before R2006a

    See Also

    |||||