Main Content

setCoefficient

Class: Aero.FixedWing
Package: Aero

Set coefficient value for Aero.FixedWing object

Syntax

aircraft = setCoefficient(aircraft,stateOutput,stateVariable,value)
aircraft = setCoefficient(__,Name,Value)

Description

aircraft = setCoefficient(aircraft,stateOutput,stateVariable,value) sets the coefficient value value to the coefficient specified by stateOutput and stateVariable and returns the modified object aircraft.

aircraft = setCoefficient(__,Name,Value) sets the coefficient value using one or more Name,Value pair arguments.

Input Arguments

expand all

Aero.FixedWing object, specified as a scalar.

Valid state output, specified in a vector of strings or character array. For more information, see Aero.FixedWing.Coefficient.

Data Types: string | char

Valid state variable, specified in a vector of strings or character array. Valid state variables depend on the coefficients defined on the object. For more information, see Aero.FixedWing.State.

Data Types: string | char

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

Data Types: string | char

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

Option to 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 Aero.FixedWing object with the modified coefficients at the specified locations, returned as a scalar.

Examples

expand all

Set a coefficient on a 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 coefficients on a 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]

Set a coefficient on a component within an Aero.FixedWing object.

C182 = astC182();
C182 = setCoefficient(C182, "CD", "Elevator", {5}, "Component", "Elevator")
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

When used with Simulink.LookupTable objects, this method requires a Simulink® license.

Version History

Introduced in R2021a