-
Notifications
You must be signed in to change notification settings - Fork 0
/
vis_scatterComparison.m
31 lines (24 loc) · 975 Bytes
/
vis_scatterComparison.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
% Read temperature and humidity from a ThingSpeak channel and visualize the
% relationship between them using the SCATTER plot
% Channel ID to read data from
readChannelID = 000000;
% Temperature Field ID
TemperatureFieldID = 1;
% Humidity Field ID
HumidityFieldID = 2;
% Channel Read API Key
% If your channel is private, then enter the read API
% Key between the '' below:
readAPIKey = '';
% Read Temperature and Humidity Data. Learn more about the THINGSPEAKREAD function by
% going to the Documentation tab on the right side pane of this page.
data = thingSpeakRead(readChannelID,'Fields',[TemperatureFieldID HumidityFieldID], ...
'NumDays',1, ...
'ReadKey',readAPIKey);
temperatureData = data(:,1);
% Read Humidity Data
humidityData = data(:,2);
% Visualize the data
scatter(temperatureData,humidityData);
xlabel('Temperature');
ylabel('Humidity');