perturb
摂動をオブジェクトに適用する
説明
は、オブジェクトに定義された摂動 offsets
= perturb(obj
)obj
を適用し、オフセット値を返します。関数 perturbations
を使用して、オブジェクトに摂動を定義できます。
例
ウェイポイント軌跡を定義します。既定では、この軌跡には 2 つのウェイポイントが含まれています。
traj = waypointTrajectory
traj = waypointTrajectory with properties: SampleRate: 100 SamplesPerFrame: 1 Waypoints: [2×3 double] TimeOfArrival: [2×1 double] Velocities: [2×3 double] Course: [2×1 double] GroundSpeed: [2×1 double] ClimbRate: [2×1 double] Orientation: [2×1 quaternion] AutoPitch: 0 AutoBank: 0 ReferenceFrame: 'NED'
Waypoints
プロパティと TimeOfArrival
プロパティで摂動を定義します。
rng(2020); perturbs1 = perturbations(traj,'Waypoints','Normal',1,1)
perturbs1=2×3 table
Property Type Value
_______________ ________ __________________
"Waypoints" "Normal" {[ 1]} {[ 1]}
"TimeOfArrival" "None" {[NaN]} {[NaN]}
perturbs2 = perturbations(traj,'TimeOfArrival','Selection',{[0;1],[0;2]})
perturbs2=2×3 table
Property Type Value
_______________ ___________ _______________________________
"Waypoints" "Normal" {[ 1]} {[ 1]}
"TimeOfArrival" "Selection" {1×2 cell} {[0.5000 0.5000]}
軌跡に摂動を与えます。
offsets = perturb(traj)
offsets=2×1 struct array with fields:
Property
Offset
PerturbedValue
Waypoints
プロパティと TimeOfArrival
プロパティを変更しました。
traj.Waypoints
ans = 2×3
1.8674 1.0203 0.7032
2.3154 -0.3207 0.0999
traj.TimeOfArrival
ans = 2×1
0
2
insSensor
オブジェクトを作成します。
sensor = insSensor
sensor = insSensor with properties: MountingLocation: [0 0 0] m RollAccuracy: 0.2 deg PitchAccuracy: 0.2 deg YawAccuracy: 1 deg PositionAccuracy: [1 1 1] m VelocityAccuracy: 0.05 m/s AccelerationAccuracy: 0 m/s² AngularVelocityAccuracy: 0 deg/s TimeInput: 0 RandomStream: 'Global stream'
それぞれ等しい可能性をもつ 3 つの値として RollAccuracy
プロパティの摂動を定義します。
values = {0.1 0.2 0.3}
values=1×3 cell array
{[0.1000]} {[0.2000]} {[0.3000]}
probabilities = [1/3 1/3 1/3]
probabilities = 1×3
0.3333 0.3333 0.3333
perturbations(sensor,'RollAccuracy','Selection',values,probabilities)
ans=7×3 table
Property Type Value
_________________________ ___________ ______________________________________
"RollAccuracy" "Selection" {1×3 cell} {[0.3333 0.3333 0.3333]}
"PitchAccuracy" "None" {[ NaN]} {[ NaN]}
"YawAccuracy" "None" {[ NaN]} {[ NaN]}
"PositionAccuracy" "None" {[ NaN]} {[ NaN]}
"VelocityAccuracy" "None" {[ NaN]} {[ NaN]}
"AccelerationAccuracy" "None" {[ NaN]} {[ NaN]}
"AngularVelocityAccuracy" "None" {[ NaN]} {[ NaN]}
関数 perturb を使用して、sensor
オブジェクトに摂動を与えます。
rng(2020) perturb(sensor); sensor
sensor = insSensor with properties: MountingLocation: [0 0 0] m RollAccuracy: 0.5 deg PitchAccuracy: 0.2 deg YawAccuracy: 1 deg PositionAccuracy: [1 1 1] m VelocityAccuracy: 0.05 m/s AccelerationAccuracy: 0 m/s² AngularVelocityAccuracy: 0 deg/s TimeInput: 0 RandomStream: 'Global stream'
RollAccuracy
が 0.5
度に摂動されます。
入力引数
出力引数
プロパティのオフセット。構造体の配列として返されます。各構造体には次のフィールドが含まれます。
フィールド名 | 説明 |
---|---|
Property | 摂動されるプロパティの名前 |
Offset | 摂動で適用されるオフセット値 |
PerturbedValue | 摂動後のプロパティ値 |
バージョン履歴
R2020b で導入
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)