{"id":3379,"date":"2012-03-09T07:03:28","date_gmt":"2012-03-09T12:03:28","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=3379"},"modified":"2016-05-17T21:19:54","modified_gmt":"2016-05-18T01:19:54","slug":"weather-at-your-fingertips","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2012\/03\/09\/weather-at-your-fingertips\/","title":{"rendered":"Weather at your fingertips"},"content":{"rendered":"<div class=\"content\">\r\n\r\n<a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\">Jiro<\/a>'s pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/35370-google-weather\">Google Weather<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/106061\">Sagar Aiya<\/a>.\r\n\r\nSince I spend a lot of my work (and some non-work) time in MATLAB, I like to do most of my computer work from within MATLAB\r\nif possible. I've used <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/matlab_external\/introducing-matlab-com-integration.html\">COM interfaces<\/a> and other <a title=\"https:\/\/www.mathworks.com\/help\/matlab\/external-interfaces.html (link no longer works)\">external interfaces<\/a> to make MATLAB do things outside of MATLAB, such as sending email through Outlook.\r\n\r\nSagar's <tt>gweather<\/tt> allows me to prolong my stay inside MATLAB by giving me the weather information right in the Command Window.\r\n\r\nHere's the weather and the forecast at MathWorks headquarter:\r\n<pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid #c8c8c8;\">gweather(<span style=\"color: #a020f0;\">'Natick, MA'<\/span>);<\/pre>\r\n<pre style=\"font-style: oblique;\">Current Conditions:\r\n19\u00b0C, 39% Humidity, Clear\r\n\r\nForecast:\r\nThu:  1\u00b0C to 18\u00b0C, Mostly Sunny\r\nFri: -2\u00b0C to  8\u00b0C, Chance of Showers\r\nSat: -2\u00b0C to  6\u00b0C, Mostly Sunny\r\nSun:  0\u00b0C to 11\u00b0C, Clear\r\n<\/pre>\r\nRight now, I'm in Philadelphia for some seminars and customer visits.\r\n<pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid #c8c8c8;\">gweather(<span style=\"color: #a020f0;\">'Philadelphia'<\/span>);<\/pre>\r\n<pre style=\"font-style: oblique;\">Current Conditions:\r\n19\u00b0C, 52% Humidity, Cloudy\r\n\r\nForecast:\r\nThu:  7\u00b0C to 20\u00b0C, Mostly Sunny\r\nFri:  2\u00b0C to 11\u00b0C, Mostly Sunny\r\nSat:  1\u00b0C to  8\u00b0C, Clear\r\nSun:  6\u00b0C to 15\u00b0C, Clear\r\n<\/pre>\r\nAnd tonight, I head up to Montreal for another seminar.\r\n<pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid #c8c8c8;\">gweather(<span style=\"color: #a020f0;\">'Montreal, QC'<\/span>);<\/pre>\r\n<pre style=\"font-style: oblique;\">Current Conditions:\r\n12\u00b0C,  0% Humidity, Light rain\r\n\r\nForecast:\r\nThu: -3\u00b0C to 12\u00b0C, Rain\r\nFri: -8\u00b0C to  0\u00b0C, Partly Sunny\r\nSat: -4\u00b0C to -1\u00b0C, Partly Sunny\r\nSun:  1\u00b0C to  8\u00b0C, Mostly Sunny\r\n<\/pre>\r\nWow, it seems unseasonably warm, but I'm not complaining right now.\r\n\r\n<b>Comments<\/b>\r\n\r\nLet us know what you think\u00a0or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/35370-google-weather#comments\">comment<\/a> for Sagar.\r\n\r\n<script>\/\/ <![CDATA[\r\nfunction grabCode_ad45eab714ab4a79a03b9d49f96f3e25() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='ad45eab714ab4a79a03b9d49f96f3e25 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' ad45eab714ab4a79a03b9d49f96f3e25';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Jiro Doke';\r\n        copyright = 'Copyright 2012 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('\r\n\r\n<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\r\n\r\n\r\n\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }\r\n\/\/ ]]><\/script>\r\n<p style=\"text-align: right; font-size: xx-small; font-weight: lighter; font-style: italic; color: gray;\">\r\n<a><span style=\"font-size: x-small; font-style: italic;\">Get\r\nthe MATLAB code\r\n<noscript>(requires JavaScript)<\/noscript><\/span><\/a>\r\n\r\nPublished with MATLAB\u00ae 7.14<\/p>\r\n\r\n<\/div>\r\n<!--\r\nad45eab714ab4a79a03b9d49f96f3e25 ##### SOURCE BEGIN #####\r\n%%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007 % Jiro>'s pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/35370-google-weather Google % Weather> by\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/106061 % Sagar Aiya>.\r\n%\r\n% Since I spend a lot of my work (and some non-work) time in MATLAB, I like\r\n% to do most of my computer work from within MATLAB if possible. I've used\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/matlab_external\/introducing-matlab-com-integration.html % COM interfaces> and other\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/external-interfaces.html external % interfaces> to make MATLAB do things outside of MATLAB, such as sending\r\n% email through Outlook.\r\n%\r\n% Sagar's |gweather| allows me to prolong my stay inside MATLAB by giving\r\n% me the weather information right in the Command Window.\r\n%\r\n% Here's the weather and the forecast at MathWorks headquarter:\r\n\r\ngweather('Natick, MA');\r\n\r\n%%\r\n% Right now, I'm in Philadelphia for some seminars and customer visits.\r\n\r\ngweather('Philadelphia');\r\n\r\n%%\r\n% And tonight, I head up to Montreal for another seminar.\r\n\r\ngweather('Montreal, QC');\r\n\r\n%%\r\n% Wow, it seems unseasonably warm, but I'm not complaining right now.\r\n%\r\n% *Comments*\r\n%\r\n% Let us know what you think\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=3370#respond here> or leave a\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/35370-google-weather#comments % comment> for Sagar.\r\n\r\n##### SOURCE END ##### ad45eab714ab4a79a03b9d49f96f3e25\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n\r\nJiro's pick this week is Google Weather by Sagar Aiya.\r\n\r\nSince I spend a lot of my work (and some non-work) time in MATLAB, I like to do most of my computer work from within MATLAB\r\nif possible.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2012\/03\/09\/weather-at-your-fingertips\/\">read more >><\/a><\/p>","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/3379"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=3379"}],"version-history":[{"count":5,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/3379\/revisions"}],"predecessor-version":[{"id":7279,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/3379\/revisions\/7279"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=3379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=3379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=3379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}