Main Content

truthlog

R2026b

Create truth log for metric evaluation from truth data

Since R2025a

    Description

    tLog = truthlog(importer,source1) returns truth log structures based on the source input. The truth log structures are useful for metric evaluation.

    example

    tLog = truthlog(importer,source1,converterName1,...,sourceN,converterNameN) imports multiple sources, each with its specified converter.

    [tLog,info] = truthlog(___) also returns info, which contains the platform IDs and class IDs mapping tables.

    Examples

    collapse all

    Load a saved truth TrackingTruthDataImporter object and display the object properties. For more information on the creation of the TrackingTruthDataImporter object, see the Import Data Using Tracking Data Importer App example.

    load truthImporterFile.mat;
    truthImporter
    truthImporter = 
    TrackingTruthDataImporter with configurations:
    
    Contained Converters:
         Converter Link     Source Type     Required Columns         
         --------------     -----------     -------------------------     
         FlightLog1         spreadsheet     time, latitude, longitude
    
    Output Data Information: 
          Coordinate Type:  Cartesian
               Frame Type:  ECEF
    
    Usage: 
          trackingScenarioRecording:  Export as a trackingScenarioRecording object for playing and metric evaluation
                           truthlog:  Export as a truth log structure for metric evaluation
                         tuningData:  Export as a tuning data structure for tracking filter turning
                     convertedTable:  Export converted table
    
    
    

    Apply the truthImporter object to a flight log named LAToBostonFlightLog.xlsx, to get truthlog.

    truthlog(truthImporter,"LAToBostonFlightLog.xlsx")
    [07-Aug-2026 01:30:36]: Start importing 'LAToBostonFlightLog.xlsx' with converter 'FlightLog1'.
    [07-Aug-2026 01:30:37]: Finish importing 'LAToBostonFlightLog.xlsx' with converter 'FlightLog1'.
    
    ans = 592×1 cell array
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
          ⋮
    
    

    Input Arguments

    collapse all

    Tracking truth data importer, specified as a TrackingTruthDataImporter object. You can use the Tracking Data Importer app to create these objects.

    Data source to read, specified as one of the following:

    • A string scalar or character vector representing the path to a data file.

    • A MATLAB® table or timetable from workspace.

    • A string array or cell array of character vectors representing paths to multiple data files of the same format.

    • A cell array of tables or timetables.

    For details on the exact format requirements for the file or table, see the display of the importer object.

    Example: "./flight_log.csv"

    Name of the converter to use for the preceding source, specified as a string scalar or character vector. The converter name must match one of the converters defined in the importer object.

    Output Arguments

    collapse all

    Truth log for metric evaluation, returned as a array of structures. You can use the truth log as inputs for the trackOSPAMetric and trackGOSPAMetric System objects.

    Platform IDs and class IDs mapping information, returned as a structure that contains two fields:

    • PlatformIDMapping — Mapping relationship between platform IDs in the source and exported platform IDs, returned as a dictionary object.

    • ClassIDMapping — Mapping relationship between class IDs in the source and exported class IDs, returned as a dictionary object.

    Version History

    Introduced in R2025a

    expand all