Main Content

exportToSimulink

Export tracking architecture to Simulink model

Since R2022a

Description

exportToSimulink(ta) exports the tracking architecture ta as a subsystem in a new Simulink® model. The Simulink model uses a default name.

exportToSimulink(ta,Model=model) specifies the name or handle of the Simulink model that the tracking architecture ta exports to. If no Simulink model with the specified name exists, the function creates a new model with the specified name.

example

modelName = exportToSimulink(___) returns the name of the model that the tracking architecture exports to.

Note

You can export a tracking architecture that contains trackerGNN, trackerJPDA, trackerTOMHT, trackerPHD, or trackFuser objects to Simulink.

You can also include customized trackers or track fusers, which inherit from the fusion.trackingArchitecture.Tracker class or the fusion.trackingArchitecture.TrackFuser class respectively, in the tracking architecture. The customized tracker or fuser object must implement an exportToSimulink object function using this syntax:

blockHandle = exportToSimulink(obj,modelName,blockName)
The function must add a block with the specified blockName to a Simulink model specified by the modelName and return the handle of the block blockHandle. The added block must have at least two input ports, one of detections or tracks (for trackers or track fuser respectively) and one of prediction time, as well as one output port of tracks.

For more information, see exportToSimulink for trackers and track fuser.

Examples

collapse all

Create a tracking architecture that has two trackers:

  • Tracker 1 — A GNN tracker that receives detections from sensors 1 and 2.

  • Tracker 2 — A JPDA tracker that receives detections from sensor 3.

The tracking architecture also contains a track fuser that receives tracks from these two trackers as well as a tracking sensor 4. Show the tracking architecture.

arch = trackingArchitecture;
addTracker(arch,trackerGNN(TrackerIndex=1),SensorIndices=[1 2])
ans=1×4 table
         System          ArchitectureInputs       FuserInputs        ArchitectureOutput
    _________________    __________________    __________________    __________________

    {'T1:trackerGNN'}         {'1  2'}         {'Not applicable'}            1         

addTracker(arch,trackerJPDA(TrackerIndex=2),SensorIndices=3)
ans=2×4 table
          System          ArchitectureInputs       FuserInputs        ArchitectureOutput
    __________________    __________________    __________________    __________________

    {'T1:trackerGNN' }         {'1  2'}         {'Not applicable'}            1         
    {'T2:trackerJPDA'}         {'3'   }         {'Not applicable'}            2         

fuser = trackFuser(FuserIndex=3,MaxNumSources=3, ...
    SourceConfigurations={fuserSourceConfiguration(1); ...
    fuserSourceConfiguration(2); fuserSourceConfiguration(4)});
addTrackFuser(arch,fuser)
ans=3×4 table
          System          ArchitectureInputs       FuserInputs        ArchitectureOutput
    __________________    __________________    __________________    __________________

    {'T1:trackerGNN' }         {'1  2'}         {'Not applicable'}            1         
    {'T2:trackerJPDA'}         {'3'   }         {'Not applicable'}            2         
    {'F3:trackFuser' }         {'4'   }         {'1  2'          }            3         

show(arch)

Figure contains an axes object. The axes object with title Tracking Architecture: arch contains 42 objects of type rectangle, text, line, patch.

Export the architecture to a Simulink model.

modelName = exportToSimulink(arch,Model='myModel')
modelName = 
'myModel'

A new model named myModel appears, which contains a tracking architecture subsystem name arch.

arch_sub.png

Open the subsystem to see the details of the tracking architecture in Simulink. Note that the subsystem reflects the settings of the trackingArchitecture object arch.

a2.png

Input Arguments

collapse all

Tracking architecture, specified as a trackingArchitecture object.

Model name or handle, specified as a string scalar, a character vector, or a Simulink handle. You can specify a model name as a string or a character vector, or a valid Simulink handle as a double.

Example: "NewModel"

Data Types: double | string | character

Output Arguments

collapse all

Name of the Simulink model, returned as a character vector.

Version History

Introduced in R2022a