perturb
Syntax
Description
applies the perturbations defined on the object, offsets
= perturb(obj
)obj
and returns the
offset values. You can define perturbations on the object by using the perturbations
function.
Examples
Perturb Accuracy of insSensor
Create an insSensor
object.
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'
Define the perturbation on the RollAccuracy
property as three values with an equal possibility each.
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" {1x3 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 the sensor
object using the perturb function.
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'
The RollAccuracy
is perturbed to 0.5
deg.
Input Arguments
obj
— Object for perturbation
object
Object for perturbation, specified as an object. The objects that you can perturb include:
Output Arguments
offsets
— Property offsets
array of structure
Property offsets, returned as an array of structures. Each structure contains these fields:
Field Name | Description |
---|---|
Property | Name of perturbed property |
Offset | Offset values applied in the perturbation |
PerturbedValue | Property values after the perturbation |
Version History
Introduced in R2024a
See Also
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.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)