Main Content

perturb

Apply perturbations to radar scenario

Since R2021a

    Description

    offsets = perturb(scenario) perturbs the baseline radar scenario, scenario, and returns offset values. Use the perturbations function to define the perturbations on objects, such as trajectories, sensors, and platforms, in the scenario.

    example

    Examples

    collapse all

    Create a radar scenario and add a platform.

    scenario = radarScenario;
    p = platform(scenario); 

    Add a trajectory to the platform.

    p.Trajectory = waypointTrajectory('Waypoints',...
        [30 -40 -3; 30 -20 -3; 20 -10 -3; 0 -10 -3; -10 -10 -3]*1e3, ...
        'TimeOfArrival', [0; 100; 150; 350; 450], ... 
        'Course', [90;90;180;180;180]); 

    Plot the trajectory.

    tp = theaterPlot("XLimits",[-20 35]*1e3,"YLimits",[-45 -5]*1e3);
    trajPlotter1 = trajectoryPlotter(tp,'DisplayName','Original','Color','b');
    plotTrajectory(trajPlotter1,{p.Trajectory.Waypoints});

    Define perturbations for the waypoints. The following defines perturbations on the first and last waypoints as uniform distributions.

    perturbations(p.Trajectory, "Waypoints", "Uniform",...
        [-2000 -2000 0; 0 0 0; 0 0 0; 0 0 0; -2000 -2000 0],...
        [+2000 +2000 0; 0 0 0; 0 0 0; 0 0 0; +2000 +2000 0]);

    Perturb the scenario and observe the changed waypoints of the platform.

    perturb(scenario);
    trajPlotter2 = trajectoryPlotter(tp,'DisplayName','Perturbed','Color','g');
    plotTrajectory(trajPlotter2,{p.Trajectory.Waypoints})

    Figure contains an axes object. The axes object with xlabel X (m), ylabel Y (m) contains 2 objects of type line. These objects represent Original, Perturbed.

    Input Arguments

    collapse all

    Radar scenario, specified as a radarScenario object.

    Output Arguments

    collapse all

    Property offsets, returned as an array of structures. Each structure contains these fields.

    Field NameDescription
    PlatformIDID of the platform
    PerturbedObjectPerturbed object mounted on the platform
    PropertyName of the perturbed property
    OffsetOffset values applied in the perturbation
    PerturbedValueProperty values after the perturbation

    Version History

    Introduced in R2021a