Ploting timeseries data in Simulink (Variable vs. HH:MM:SS).
1 次查看(过去 30 天)
显示 更早的评论
I have a Simulink block that calls a user-defined function. This function calls another function: thingspeakread.m (provided by the ThingSpeak Official Toolbox).
From here, I want two outcomes. Data (numeric type, vector), and timestamps (strings, vector).
[data,timestamps] = thingSpeakRead(___)
Now, I'm able to get the values of "Data" into a Scope without much of an issue (using coder.extrinsic('thingSpeakRead') and preallocating the variable to store such points). The issue I have is this: I need to make more sense of the data visualization, and for that purpose, I need to plot this "Data" against the information displayed in the timestamps vector. The timestamps varies per minute only.
What I'll try to do, but doesn't satisfies me a lot:
- Convert the timestamp into a numeric value using datenum() using the format for 'mm/dd/yyyy HH:MM:SS'
This option sends back a huge number (which can be used to plot Data vs. Time indeed, but it doesn't look 'good' because the number is just too big and I don't like it).
I have thought about these too:
- Convert date to Julian Date type.
- Convert Hours, Minutes and Seconds into 3 different arrays.
But I don't see that getting me where I want (which is to plot Data vs. Time, being able to spot easily that the numbers displayed for "Time" are corresponding to an specific HH:MM:SS of a day).
Is there anything you can guys suggest, please? Thanks a lot in advance!
0 个评论
回答(0 个)
社区
更多回答在 ThingSpeak Community
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Programmatic Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!