Combine 3 private channels in to one graph | 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
Combine 3 private channels in to one graph
Avatar
jamin
New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
1
June 21, 2016 - 8:37 am
sp_Permalink sp_Print

Hey,

Im trying to get around the 15 sec update limit by having 3 channels that update depending on a few counters on the arduino.

I was hoping the next part would be easy, but it isn't.

The data I am sending to each channel is very basic. Its a door bell counter, so its either 0 or 1.

If the bell is pressed a few times within 15 seconds, then it will send the three 1's to different channels. The rest of the presses are disregarded.

I would like to show the combined presses with a 30sec timescale on another channel as a vertical line graph.

Can anyone help?

 

This is what I have so far:

 

readChannelID1 = XXXXXX;
readChannelID2 = XXXXXX;
readChannelID3 = XXXXXX;

readAPIKey1 = 'XXXXXXXXXXXXXXXXX';
readAPIKey2 = 'XXXXXXXXXXXXXXXXX';
readAPIKey3 = 'XXXXXXXXXXXXXXXXX';

chan1 = thingSpeakRead(readChannelID1, 'Fields', 1, 'ReadKey', readAPIKey1, 'NumDays',2);
chan2 = thingSpeakRead(readChannelID2, 'Fields', 1, 'ReadKey', readAPIKey2, 'NumDays',2);
chan3 = thingSpeakRead(readChannelID3, 'Fields', 1, 'ReadKey', readAPIKey3, 'NumDays',2);

thingSpeakPlot(chan1, chan2, chan3);
Avatar
rw950431

Forum Posts: 252
sp_UserOfflineSmall Offline
2
June 21, 2016 - 8:39 pm
sp_Permalink sp_Print

Suspect you need to read the timestamps as well as the data from the 3 channels .   I dont know enough Matlab to show exactly how to do this Frown  maybe this will work, maybe not

 

[data1,time1] = thingSpeakRead(..)
[data2,time2] = thingSpeakRead(..)
[data3,time3] = thingSpeakRead(..)

plot(time1,data1,time2,data2,time3,data3)

 

(Based off https://au.mathworks.com/help/matlab/ref/plot.html)

Avatar
jamin
New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
3
June 22, 2016 - 3:12 am
sp_Permalink sp_Print

Hey rw950431,

This is creating the error

Error using horzcat
Dimensions of matrices being concatenated are not consistent.

Will keep searching Google.

Cheers

Avatar
rw950431

Forum Posts: 252
sp_UserOfflineSmall Offline
4
June 22, 2016 - 9:52 pm
sp_Permalink sp_Print

Guessing that its complaining because the arrays have different numbers of data points..  Does it work if you only plot one series at a time?

plot(time1,data1)

You may end having to figure out how to merge the 3 datasets together before plotting- please show me how to do it when you figure it out..

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online: cstapels
17 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

Nsneilotof

angieus2

goldiepw11

BinanceoSt

gnarender123@gmail.com

edenderest

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee