在需要转化的ulog文件目录下
执行
ulog2csv XXX.ulog,会自动在当前目录下生成一系列csv文件

将csv文件拖到matlab界面中,会弹出下面的页面,点击导入
ubuntu下ulog文件转csv文件并在matlab里画图_当前目录

会提示导入到工作区,这时可以调用画线函数plot进行划线
ubuntu下ulog文件转csv文件并在matlab里画图_工作区_02

ubuntu下ulog文件转csv文件并在matlab里画图_文件目录_03

调用
plot(log520201010105015sensormag0.timestamp,log520201010105015sensormag0.x)
可以得到一条线
如果要在同一个页面画多条线,可以用hold on

plot(log520201010105015sensormag0.timestamp,log520201010105015sensormag0.x)
hold on
plot(log520201010105015sensormag0.timestamp,log520201010105015sensormag0.y)

得到下图
ubuntu下ulog文件转csv文件并在matlab里画图_工作区_04
给曲线添加注释可以通过legend(‘UAV1’,‘UAV2’,‘UAV3’,‘UAV4’,‘UAV5’);