Main Content

setCoefficient

Class: Aero.FixedWing.Coefficient
Namespace: Aero

Set coefficient values for fixed-wing coefficient object

Since R2021a

Syntax

fixedWingCoefficient = setCoefficient(fixedWingCoefficient,stateOutput,stateVariable,value)
fixedWingCoefficient = setCoefficient(___,Name,Value)

Description

fixedWingCoefficient = setCoefficient(fixedWingCoefficient,stateOutput,stateVariable,value) sets the coefficient value value to the coefficient specified by stateOutput and stateVariable and returns the modified Aero.FixedWing.Coefficient object.

fixedWingCoefficient = setCoefficient(___,Name,Value) sets the coefficient value value to the coefficient specified by stateOutput and stateVariable and returns the modified object.

Input Arguments

expand all

Aero.FixedWing.Coefficient on which to set coefficient, specified as a scalar.

State output, specified as a 6-by-1 vector where each entry is a valid state output. For more information on state outputs, see Aero.FixedWing.Coefficient.

Data Types: char | string

State variable, specified as a vector where each entry is a valid state variable. Valid state variables depend on the coefficients defined on the object. For more information on fixed-wing states, see Aero.FixedWing.State.

Data Types: char | string

State values, specified as a vector of cells where each cell is a numeric constant or a Simulink.LookupTable object. For more information on coefficient values, see Aero.FixedWing.Coefficient.

Data Types: double

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'AddVariable','on'

Component name, specified as a string. Valid component names depend on the object properties and all subcomponents on the object. The default component name is the current object.

Data Types: char | string

Add state variable if desired state variable is missing, specified as:

  • 'on' — Add a state variable.

  • 'off' — Do not add a state variable.

Data Types: logical

Output Arguments

expand all

Modified fixed-wing coefficient object on which coefficient is set, returned as Aero.FixedWing.Coefficient.

Examples

expand all

Set a coefficient on an Aero.FixedWing object.

C182 = astC182();
C182 = setCoefficient(C182, "CD", "Alpha", {5})
C182 = 

  FixedWing with properties:

        ReferenceArea: 174
        ReferenceSpan: 36
      ReferenceLength: 4.9000
         Coefficients: [1×1 Aero.FixedWing.Coefficient]
     DegreesOfFreedom: "6DOF"
             Surfaces: [1×3 Aero.FixedWing.Surface]
              Thrusts: [1×1 Aero.FixedWing.Thrust]
          AspectRatio: 7.4483
           UnitSystem: "English (ft/s)"
          AngleSystem: "Radians"
    TemperatureSystem: "Fahrenheit"
           Properties: [1×1 Aero.Aircraft.Properties]

Set a vector of coefficient values on an Aero.FixedWing.Control object.

C182 = astC182();
C182 = setCoefficient(C182, ["CY"; "Cm"], ["Zero"; "Alpha"], {5; Simulink.LookupTable})
C182 = 

  FixedWing with properties:

        ReferenceArea: 174
        ReferenceSpan: 36
      ReferenceLength: 4.9000
         Coefficients: [1×1 Aero.FixedWing.Coefficient]
     DegreesOfFreedom: "6DOF"
             Surfaces: [1×3 Aero.FixedWing.Surface]
              Thrusts: [1×1 Aero.FixedWing.Thrust]
          AspectRatio: 7.4483
           UnitSystem: "English (ft/s)"
          AngleSystem: "Radians"
    TemperatureSystem: "Fahrenheit"
           Properties: [1×1 Aero.Aircraft.Properties]

Limitations

The vectors for the stateOutput, stateVariable, and value arguments must be the same length.

Version History

Introduced in R2021a