주요 콘텐츠

perturb

객체에 섭동 적용

R2024a 이후

설명

offsets = perturb(obj)obj 객체에 정의된 섭동을 적용하고 오프셋 값을 반환합니다. 객체에 대한 섭동은 perturbations 함수를 사용하여 정의할 수 있습니다.

예제

예제

모두 축소

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섭동 후의 속성값

    버전 내역

    R2024a에 개발됨

    참고 항목