Main Content

plotSensorData

R2026b

Plot sensor data in trackingGlobeViewer using sensor specifications

Since R2026b

    Description

    plotSensorData(viewer,sensorData,sensorSpecs) plots the sensor data on the tracking globe viewer using the sensor specifications specified by sensorSpecifications.

    example

    plotSensorData(___,Name=Value) specifies options using one or more name-value arguments. For example, plotSensorData(viewer,radarData,radarSpecs,Color=[1 0 0]) specifies the color of the plotted detections as the RGB triplet [1 0 0].

    example

    Examples

    collapse all

    Create a tracking globe viewer and specify its reference location and camera position.

    refloc = [42.39423231362 -70.95934958874 0];
    mapViewer = trackingGlobeViewer('ReferenceLocation',refloc,'Basemap','streets-dark');
    campos(mapViewer,refloc + [0 0 1e5]);

    Load the sensor data and specifications for a monostatic radar and an ESM radar.

    load("sensorDataFromTwoSensors.mat");

    Plot detections for both radars and specify the color for the detections from each sensor. Take a snapshot to show the results.

    plotSensorData(mapViewer, {radar1Data,radar2Data}, ...
        {radar1Spec,radar2Spec},Color=[1 0 0; 0 1 0])
    drawnow
    pause(20)
    snapshot(mapViewer)

    Figure contains an axes object. The hidden axes object contains an object of type image.

    Additionally, you can plot the coverage of the radars using the plotCoverage function.

    plotCoverage(mapViewer, {radar1Data,radar2Data}, ...
        {radar1Spec,radar2Spec},Color=[1 0 0; 0 1 0],Alpha=0.1)
    drawnow
    snapshot(mapViewer)

    Figure contains an axes object. The hidden axes object contains an object of type image.

    Input Arguments

    collapse all

    Tracking globe viewer, specified as a trackingGlobeViewer object.1

    Sensor data reported by each sensor, specified as a structure or a cell array of structures. The length and order of elements in the sensorData argument must match the length and order of sensor specifications in the sensorSpecs argument.

    Sensor specifications, specified as a sensor specification object or a cell array of sensor specification objects. The length and order of sensor specifications in the sensorSpecs argument must match the length and order of elements in the sensorData argument.

    You can use the trackerSensorSpec function to generate sensor specification objects.

    Note

    To use the plotSensorData function, you must set the IsGeographic property of all sensor specifications to true.

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: plotSensorData(viewer,radarData,radarSpec,Color=[1 0 0])

    Color of detections, specified as:

    • "auto" — Automatically select the color from a limited set of colors based on the SensorIndex property or field of each detection.

    • A 1-by-3 RGB triplet — Plot all the detections with the same color.

    • An N-by-3 matrix of RGB triplets — Plot detections from each sensor with a different color. N is the length of the sensorSpecs and sensorData arguments. In this way, you can specify different colors for detections generated from different sensors.

    Face alpha value for the covariance patch, specified as a scalar in the range [0 1].

    Size of marker, specified as a positive integer.

    Version History

    Introduced in R2026b


    1 Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®.