Here is the basic code that gets the job done for the CCNY location. If you are interested to get multiple data, just append it to the update trend array:
% Get the data from CCNY, update the trendyThe Trendy then can be used to plot the gathered data. I had to let it gather data for few days before I could plot some nice trends. You can already see the diurnal variation in the data below.
url = 'http://www.dec.ny.gov/airmon/stationStatus.php?stationNo=73';
count = urlfilter(url, 'PM25C'); % reading
PMccny = count; % PM at CCNY
updatetrend([PMccny]);
PM2.5 trend in NYC. If the image is not available, follow the link below. |
http://www.mathworks.com/matlabcentral/trendy/plots/1349
The plots can be made with the following code (the time and data will be different for your code):
% PM2.5 hourly measurements in CCNYI can also set up an email alert if the PM2.5 reading gets higher than some threshold, say 35ugm/m3. Now you can think about the useful applications of such tools!!
% time vector is: time2322
% data vector is: data2322
plot(time2322,data2322, 'o-');
datetick
hleg = legend('PM2.5(ug/m3)', 'Location', 'SouthWest');
set(hleg, 'FontSize', 8);
title('Air Quality at CCNY station');
Update: well, it has been deprecated! and replaced with "trendy"