Main Content

truthlog

Create truth log for metric evaluation from truth data

Since R2025a

    Description

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

    example

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

    Examples

    collapse all

    Loads a saved truth TrackingTruthDataImporter object and displays 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:
    
    Converter Name: FlightLog1
    Input File Format: spreadsheet
    Input Data Information: 
            Category:  Flight Log
          Frame Type:  Local NED
    
    Elements and Mapping: 
         State Element     Unit       Original Column     Unit(Format)                         
         -------------     ------     ---------------     -------------------------------------     
         Date Time         sec        time                datetime string(dd-MMM-yyyy HH:mm:ss)
         Latitude          degree     latitude            degree                               
         Longitude         degree     longitude           degree                               
         Altitude          m          altitude            ft                                   
         Speed             m/s        speed               mi/h                                 
         Course            degree     course              degree                               
         Climb Rate        m/s        climbrate           ft/m                                 
    
    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")
    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 a string scalar representing the path to a data file, or as a MATLAB table or timetable from workspace.

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

    Example: "./flight_log.csv"

    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