3:47 am

Gold

July 22, 2016

Dear All,

It seems that I like ThingSpeak service very much but as usually I want to get a little bit more than the standart functionality can offer. For example I colled data from a Gas Meter and do that with real digits. That means that every single update increases number. And always I can see my Gas meter actual values. But I also would like to get momentum values of consumtion with slices 15 or 60 minutes.

In that case I need to get data from my channel and substract every value precedessor from the current value. Then, as I guess, I need to put these substracted values to a new channel (or field) and build a graph that will show me real consumption for every time period.

But the problem is that I don't understand the principles how MatLab (Analyst mostly). And can't route my work into the right direction. Where can I read something on order to understand the language principles, sintaxsys and other core things of the used languages?

5:25 pm

MathWorks

April 29, 2016

Hi,

I am not sure if I understand 100% about what you want to achieve, nevertheless I will try to provide my suggestions.

- Create/Open a MATLAB Analysis app.
- Use the thingSpeakRead function in the MATLAB Analysis to read data from your channel that contains the Gas meter actual values.
- Use the diff function in MATLAB to substract every value precedessor from the current value. (there are also other similar arithmetic MATLAB functions that you can find in this page)
- Use the thingSpeakWrite function to write the values back into a new a channel.

There are many built-in MATLAB functions for using basic descriptive statistics. Also, since now ThingSpeak supports MATLAB Toolboxes, you can use advanced MATLAB functions that belong to these toolboxes - some examples of using functions from these toolboxes in ThingSpeak can be found here.

If you are looking to learn MATLAB from the basics, you can visit the MATLAB Getting Started page which has links to nice tutorials of how to get started using MATLAB. Also, you have the MATLAB Central where you can ask MATLAB users and get responses for any MATLAB related questions that you may have. And you can visit the MATLAB File Exchange to find MATLAB code that other MATLAB users have posted that may help you.

4:48 am

Gold

July 22, 2016

jvasudev saidIf you are looking to learn MATLAB from the basics, you can visit the MATLAB Getting Started page which has links to nice tutorials of how to get started using MATLAB. Also, you have the MATLAB Central where you can ask MATLAB users and get responses for any MATLAB related questions that you may have. And you can visit the MATLAB File Exchange to find MATLAB code that other MATLAB users have posted that may help you.

thank you very much, will try to use these suggestions!

4:18 am

Gold

July 22, 2016

jvasudev said

Hi,I am not sure if I understand 100% about what you want to achieve, nevertheless I will try to provide my suggestions.

Hello **jvasudev,**

I've manage to realize two new grpahs using ThingSpeak MATLAB Analysis apps. The first app reads twice values from one field and calculates difference between two values in hour time. The pbolem here that not every record in the original field contains data. I update the original channel with 8 fields but not all of them have values at the time of update. So here I get hourly consumption of my gas. And I write it to a new channel.

The second app does a little bit different work. It calculates momentum consumption. It uses diff function (I hope that this is a function) and the result is written to a new field. If there are some NaN values that is OK. As I understand from the description they are processed correctly by diff function.

So, now I have two new fields with consumption values (hourly and momentum). But I'd like to generate bars graph not ordinary grpah. Is it possible with ThingSpeak somehow?

Update: I think that I'll be able to do so with MATLAB Visualization app 🙂

PS. Here are two usefull links for MATLAB and ThingSpeak online reference manuals:

http://www.mathworks.com/help/matlab/functionlist.html

http://www.mathworks.com/help/thingspeak/functionlist.html

They helped me very much.

6:31 pm

MathWorks

August 17, 2015

You are right. You can use MATLAB Visualization app.

checkout 'bar' function from MATLAB: https://www.mathworks.com/help/matlab/ref/bar.html

In the following article, refer 'Looking at Weekly Sums for Eastbound and Westbound Traffic and Plotting' section to learn more about plotting bar graphs:

http://makerzone.mathworks.com/blog/counting-cars-and-analyzing-traffic-raspberry-pi-thingspeak/

Hope this helps. Feel free to share your final Visualization.

11:38 am

Gold

July 22, 2016

Meenakshi said

You are right. You can use MATLAB Visualization app.checkout 'bar' function from MATLAB: https://www.mathworks.com/help/matlab/ref/bar.html

In the following article, refer 'Looking at Weekly Sums for Eastbound and Westbound Traffic and Plotting' section to learn more about plotting bar graphs:

http://makerzone.mathworks.com/blog/counting-cars-and-analyzing-traffic-raspberry-pi-thingspeak/

Hope this helps. Feel free to share your final Visualization.

Thank you for the good example. I'm already managed to use bar grpah and get something like this:

I use the following code:

figure

bar(timeStamp, GasImpNow);

xlabel('Время');

ylabel('Потребление, кб. м.');

title('Потребление газа за последние 24 часа');

ax=gca;

%set(gca,'XTickLabel', timeStamp);

grid on

But the graph doesn't look pretty. The bars are too thin and the date labels are not very informative. But I can't impruve it easily. If I use XTickLabel I need to convert timeStamp into Strings and I receive just empthy graph. I also tried to collapse timeStamp into only hours because I use 24 hours graph frame but with no success.

The hard way is to process all the data into a much simplified data. Where I collect all the data into hour frames or something like this.

Most Users Ever Online: 114

Currently Online: Hans, agrisensezm

37 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:

Archieter, JamesExedo, IrbosHich, brodi, kasko, franklin castroAdministrators: Hans: 387, lee: 457