Main Content


Read messages from ULOG file

Since R2020b


The ulogreader object reads a ULOG file (.ulg). The object stores information about the file, including start and end logging times, summary of available topics, and dropout intervals.




ulogOBJ = ulogreader(filePath) reads the ULOG file from the specified path and returns an object containing information about the file. The information in filePath is used to set the FileName property.


expand all

This property is read-only.

Name of the ULOG file, specified as a string scalar or character vector. The FileName is the path specified in the filePath input.

Data Types: char | string

This property is read-only.

Start time of logging offset from the system start time in the ULOG file, specified as a duration object in the 'hh:mm:ss.SSSSSS' format.

Data Types: duration

This property is read-only.

Timestamp of the last timestamped message logged in the ULOG file, specified as a duration object in the 'hh:mm:ss.SSSSSS' format.

Data Types: duration

This property is read-only.

Summary of all the logged topics, specified as a table that contains the columns:

  • TopicNames

  • InstanceID

  • StartTimestamp

  • LastTimestamp

  • NumMessages

Data Types: table

This property is read-only.

Time intervals in which messages were dropped while logging, specified as an n-by-2 matrix of duration arrays in the 'hh:mm:ss.SSSSSS' format, where n is the number of dropouts.

Data Types: duration

Object Functions

readTopicMsgsRead topic messages
readSystemInformationRead information messages
readParametersRead parameter values
readLoggedOutputRead logged output messages


collapse all

Load the ULOG file. Specify the relative path of the file.

ulog = ulogreader('flight.ulg');

Read all topic messages.

msg = readTopicMsgs(ulog);

Specify the time interval between which to select messages.

d1 = ulog.StartTime;
d2 = d1 + duration([0 0 55],'Format','hh:mm:ss.SSSSSS');

Read messages from the topic 'vehicle_attitude' with an instance ID of 0 in the time interval [d1 d2].

data = readTopicMsgs(ulog,'TopicNames',{'vehicle_attitude'}, ... 
'InstanceID',{0},'Time',[d1 d2]);

Extract topic messages for the topic.

vehicle_attitude = data.TopicMessages{1,1};

Read all system information.

systeminfo = readSystemInformation(ulog);

Read all initial parameter values.

params = readParameters(ulog);

Read all logged output messages.

loggedoutput = readLoggedOutput(ulog);

Read logged output messages in the time interval.

log = readLoggedOutput(ulog,'Time',[d1 d2]);


[1] PX4 Developer Guide. "ULog File Format." Accessed December 6, 2019.

Version History

Introduced in R2020b

See Also