MATLAB:从struct绘制数据 [英] MATLAB: plotting data from struct

查看:112
本文介绍了MATLAB:从struct绘制数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据结构,其中包含数据值,时间,单位以及每个数据的一些描述.我想绘制数据值与时间的关系. 数据如下所示:

I have a structure of data that contains data values, time, unit, and some descriptions of each data. I want to plot the data values vs time. Here is how the data looks like:

有什么想法可以绘制数据和时间吗?

Any ideas how i can plot the data and time?

推荐答案

快速示例:

%# date strings and values
dates = {'02.11.2012 00:02:15'; '02.11.2012 00:07:12'};
values = [5.8; 5.7];

%# convert to serial date numbers
t = datenum(dates, 'mm.dd.yyyy HH:MM:SS');

%# plot and format x-ticks as datetime
plot(t,values)
datetick('x')

这篇关于MATLAB:从struct绘制数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆