주요 콘텐츠

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'         

RollAccuracy 속성에 대한 섭동을 각각 동일한 확률을 갖는 3개의 값으로 정의합니다.

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'         

RollAccuracy0.5도로 섭동됩니다.

입력 인수

모두 축소

섭동할 객체로, 객체로 지정됩니다. 섭동할 수 있는 객체에는 다음이 포함됩니다.

출력 인수

모두 축소

속성 오프셋으로, 구조체로 구성된 배열로 반환됩니다. 각 구조체에는 다음과 같은 필드가 포함되어 있습니다.

필드 이름설명
Property섭동된 속성 이름
Offset섭동에 적용된 오프셋 값
PerturbedValue섭동 후의 속성값

버전 내역

R2020b에 개발됨

참고 항목