主要内容

GetAllTerms

List all model terms

    Description

    Terms = GetAllTerms(Model) returns a list of all terms in mbcmodel.linearmodel object.

    example

    Examples

    collapse all

    Create a model and find which terms are quadratic in the first input factor.

    Create a model.

    model = mbcmodel.CreateModel('Polynomial', 2)
    model =
     
       1 + 2*X1 + 8*X2 + 3*X1^2 + 6*X1*X2 + 9*X2^2 + 4*X1^3
         + 5*X1^2*X2 + 7*X1*X2^2 + 10*X2^3                                                                       
       InputData: [0x2 double]
       OutputData: [0x1 double]
       Status: Not fitted
       Linked to Response: <not linked>

    Find which terms are quadratic in the first input factor.

    terms = model.Properties.GetAllTerms;
    x1quadraticterms = find(terms(:,1)==2)
    x1quadraticterms =
    
         4
         8

    Input Arguments

    collapse all

    Linear model, specified as a mbcmodel.linearmodel object.

    Output Arguments

    collapse all

    Terms in mbcmodel.linearmodel object, returned as an m-by-n array. m is the number of terms. n is the number of factors. The (m,n)th element is the power of the nth factor in the mth term.

    Version History

    Introduced in R2007a