Displaying Sum for the day and specific hours | MATLAB | Forum


Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Displaying Sum for the day and specific hours
No permission to create posts
July 18, 2017
7:10 pm

Forum Posts: 8
Member Since:
July 13, 2017
sp_UserOfflineSmall Offline

Hello Guys,


I am getting data from flow sensor and I want to calculate and display total liquid recorded for a day and for a specific hour. How can I do that using MATLAB Visualizations or Analysis? 

Thank you and I look forward to some great suggestions.

Best Regards


July 20, 2017
3:48 pm

Forum Posts: 365
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline


There is an example of how to aggregate data in the documentation here.  You can find more information on retime in the main MATLAB documentation. You can also use the mean function in MATLAB to create an average value.  Read the data using MATLAB analysis into a variable using thingspeakRead() (you could use the 'NumPoints' or 'NumMinutes' to select a slice of your data.)  Then you can use the between function to calculate the elapsed time between your first and last points.  Multiple the average flow rate by the time to get the total liquid.  Then use the thingSpeakWrite() to write the data to another channel, or another field of the same channel.  And if you really want to get fancy, you can create a plugin to display the numbers you are looking for on your private view of the channel.

Good luck!

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
32 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

JudestAboth, concettazx4, lyndarf60, caseybo16, iodiree, emiliacz4

Administrators: Hans: 387, lee: 457