Main Content

getCoefficient

Class: Aero.FixedWing
Namespace: Aero

Get coefficient value for Aero.FixedWing object

Since R2021a

Syntax

value = getCoefficient(aircraft,stateOutput,stateVariable)
value = getCoefficient(___,Name,Value)

Description

value = getCoefficient(aircraft,stateOutput,stateVariable) gets the coefficient value value from the coefficient specified by stateOutput and stateVariable.

value = getCoefficient(___,Name,Value) gets the coefficient value using one or more Name,Value pairs.

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.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: 'Component','Hello'

Aero.FixedWing.State object to calculate numeric values of Simulink.LookupTable objects, specified as a scalar.

Data Types: double

Valid component name, specified as a scalar string. Valid component names depend on the 'Name' property of an object and all its subcomponents. The default component is the current object.

Data Types: char | string

Output Arguments

expand all

Coefficient values, returned as a value of the same size as stateOutput and stateVariable. Vector contents depend on the type of coefficients in the vector.

Type of Coefficients in VectorVector

All numeric constants

Numeric vector

Simulink.LookupTable objects

Vector of Simulink.LookupTable objects

Mix of numeric constants and Simulink.LookupTable objects

Vector of cells

Simulink.LookupTable objects with state included

Numeric vector

Examples

expand all

This example shows how to get coefficient values for Aero.FixedWing objects.

Get Coefficient for Angle of Attack

Get a CD_alpha on an Aero.FixedWing object.

C182 = astC182();
CD_alpha = getCoefficient(C182, "CD", "Alpha")
CD_alpha = 
0.1210

Get Vector of Coefficient Values

Get a vector of coefficient values on a component within an Aero.FixedWing object.

C182 = astC182();
coeffs = getCoefficient(C182,{'CY'; 'Cm'},{'Aileron';'Aileron'},'Component','Aileron')
coeffs = 1×2

     0     0

Get Simulink.LookupTable Coefficient

Get a Simulink.LookupTable coefficient from an Aero.FixedWing object.

SkyHogg = astSkyHogg();
Cl_zero = getCoefficient(SkyHogg,"Cl","Zero")
Cl_zero = 
0

Get Simulink.LookupTable Coefficient with State

Get a Simulink.LookupTable coefficient from an Aero.FixedWing object and include a state.

[SkyHogg, CruiseState] = astSkyHogg();
Cl_zero = getCoefficient(SkyHogg, "Cl", "Zero", "State", CruiseState)
Cl_zero = 
0

Limitations

  • Each vector of inputs stateOutput and stateVariable must be the same length.

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

Version History

Introduced in R2021a