setState
Class: Aero.FixedWing.State
Namespace: Aero
Syntax
state = setState(state,statename,value)
Description
sets the state state
= setState(state
,statename
,value
)value
to a specified state name value.
Input Arguments
state
— Aero.FixedWing.State
object
scalar
Aero.FixedWing.State
object, specified as a scalar.
statename
— State names
vector
State names, specified in a vector. You cannot set effective control variables
created with asymmetric control surfaces. For more information on state names, see the
Aero.FixedWing.State
Properties.
Tip
Each vector of statename
and value
must
be the same length.
Data Types: char
| string
value
— State values
vector
State values, specified as a vector.
If the states are all scalar constants,
value
is a numeric vector.If one of more states are not scalar constants,
value
is a cell vector.
Tip
Each vector of statename
and value
must
be the same length.
Output Arguments
state
— Modified Aero.FixedWing.State
object
vector
Modified input object with the modified states at the specified locations.
Examples
Set State Value to Specified State Name
These examples show how to set the state value to specified state name.
Set Pitch Angle of Cruise State
Set the pitch angle of a cruise state.
[C182, CruiseState] = astC182();
CruiseState = setState(CruiseState, "Alpha", 5)
CruiseState = State with properties: Alpha: NaN Beta: NaN AlphaDot: 0 BetaDot: 0 Mass: 82.2981 Inertia: [3x3 table] CenterOfGravity: [1.2936 0 0] CenterOfPressure: [1.2250 0 0] AltitudeMSL: 5000 GroundHeight: 0 XN: 0 XE: 0 XD: -5000 U: 220.1000 V: 0 W: 0 Phi: 0 Theta: -0.0073 Psi: 0 P: 0 Q: 0 R: 0 Weight: 2.6488e+03 AltitudeAGL: 5000 Airspeed: NaN GroundSpeed: 220.1000 MachNumber: NaN BodyVelocity: [NaN NaN NaN] GroundVelocity: [220.1000 0 0] Ur: NaN Vr: NaN Wr: NaN FlightPathAngle: 0 CourseAngle: 0 InertialToBodyMatrix: [3x3 double] BodyToInertialMatrix: [3x3 double] BodyToWindMatrix: [3x3 double] WindToBodyMatrix: [3x3 double] BodyToStabilityMatrix: [3x3 double] StabilityToBodyMatrix: [3x3 double] DynamicPressure: NaN Environment: [1x1 Aero.Aircraft.Environment] ControlStates: [1x4 Aero.Aircraft.ControlState] OutOfRangeAction: "Limit" DiagnosticAction: "Warning" Properties: [1x1 Aero.Aircraft.Properties] UnitSystem: "English (ft/s)" TemperatureSystem: "Fahrenheit" AngleSystem: "Radians"
Set U, V, and W Velocity Components
Set the U, V, and W velocity components of a cruise state.
[C182, CruiseState] = astC182(); CruiseState = setState(CruiseState, ["U", "V", "W"], [50, 1, 10])
CruiseState = State with properties: Alpha: 0.1974 Beta: 0.0196 AlphaDot: 0 BetaDot: 0 Mass: 82.2981 Inertia: [3x3 table] CenterOfGravity: [1.2936 0 0] CenterOfPressure: [1.2250 0 0] AltitudeMSL: 5000 GroundHeight: 0 XN: 0 XE: 0 XD: -5000 U: 50 V: 1 W: 10 Phi: 0 Theta: -0.0073 Psi: 0 P: 0 Q: 0 R: 0 Weight: 2.6488e+03 AltitudeAGL: 5000 Airspeed: 51 GroundSpeed: 51 MachNumber: 0.0465 BodyVelocity: [50 1 10] GroundVelocity: [50 1 10] Ur: 50 Vr: 1 Wr: 10 FlightPathAngle: 0.1974 CourseAngle: 0.0200 InertialToBodyMatrix: [3x3 double] BodyToInertialMatrix: [3x3 double] BodyToWindMatrix: [3x3 double] WindToBodyMatrix: [3x3 double] BodyToStabilityMatrix: [3x3 double] StabilityToBodyMatrix: [3x3 double] DynamicPressure: 2.6636 Environment: [1x1 Aero.Aircraft.Environment] ControlStates: [1x4 Aero.Aircraft.ControlState] OutOfRangeAction: "Limit" DiagnosticAction: "Warning" Properties: [1x1 Aero.Aircraft.Properties] UnitSystem: "English (ft/s)" TemperatureSystem: "Fahrenheit" AngleSystem: "Radians"
Version History
Introduced in R2021a
See Also
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)