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

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





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

Register Lost password?
sp_Feed sp_TopicIcon
Displaying Sum for the day and specific hours
Avatar
rushanarshad

Silver
Forum Posts: 8
sp_UserOfflineSmall Offline
1
July 18, 2017 - 7:10 pm
sp_Permalink sp_Print

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

Rushan

Avatar
cstapels

Gold
Forum Posts: 60
sp_UserOfflineSmall Offline
2
July 20, 2017 - 3:48 pm
sp_Permalink sp_Print

Rushan,

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:
20 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 250

Vinod: 152

piajola: 74

vespapierre: 63

cstapels: 60

Adarsh_Murthy: 59

Newest Members:

bharad

mikebradley

gilloliver

chputney

fibula

namansahore

Forum Stats:

Groups: 4

Forums: 17

Topics: 1261

Posts: 4400

 

Member Stats:

Guest Posters: 1

Members: 5588

Moderators: 0

Admins: 2

Administrators: Hans, lee