{"id":347,"date":"2009-01-07T18:52:09","date_gmt":"2009-01-07T18:52:09","guid":{"rendered":"https:\/\/blogs.mathworks.com\/videos\/2009\/01\/07\/binning-data-in-matlab\/"},"modified":"2016-04-04T12:47:03","modified_gmt":"2016-04-04T17:47:03","slug":"binning-data-in-matlab","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/videos\/2009\/01\/07\/binning-data-in-matlab\/","title":{"rendered":"Binning data in MATLAB"},"content":{"rendered":"I have been reading the <a href=\"http:\/\/stackoverflow.com\/questions\/tagged\/matlab\">MATLAB questions in Stack Overflow<\/a> for a few weeks, and here was <a href=\"http:\/\/stackoverflow.com\/questions\/419223\/binning-in-matlab\">a really good question<\/a> that came through.\r\n\r\nWith two vectors, <strong>x<\/strong> and <strong>y<\/strong>, bin the <strong>x<\/strong> values as if with a histogram. Then take the corresponding <strong>y<\/strong> values in each bin and take the mean. This uses HISTC and indexing. Mostly this is applying skills from earlier videos.\r\n<div><div class=\"row\"><div class=\"col-xs-12 containing-block\"><div class=\"bc-outer-container add_margin_20\"><videoplayer><div class=\"video-js-container\"><video data-video-id=\"3877438005001\" data-video-category=\"blog\" data-autostart=\"false\" data-account=\"62009828001\" data-omniture-account=\"mathwgbl\" data-player=\"rJ9XCz2Sx\" data-embed=\"default\" id=\"mathworks-brightcove-player\" class=\"video-js\" controls><\/video><script src=\"\/\/players.brightcove.net\/62009828001\/rJ9XCz2Sx_default\/index.min.js\"><\/script><script>if (typeof(playerLoaded) === 'undefined') {var playerLoaded = false;}(function isVideojsDefined() {if (typeof(videojs) !== 'undefined') {videojs(\"mathworks-brightcove-player\").on('loadedmetadata', function() {playerLoaded = true;});} else {setTimeout(isVideojsDefined, 10);}})();<\/script><\/div><\/videoplayer><\/div><\/div><\/div><\/div>\r\nI really like the Stack Overflow community, and am glad to see the MATLAB questions are being discussed there. Do you have any favorite communities, apart from <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/\">MATLAB Central<\/a>, that you like to use?","protected":false},"excerpt":{"rendered":"<div class=\"thumbnail thumbnail_asset asset_overlay video\"><a href=\"https:\/\/blogs.mathworks.com\/videos\/2009\/01\/07\/binning-data-in-matlab\/?dir=autoplay\"><img decoding=\"async\" src=\"https:\/\/cf-images.us-east-1.prod.boltdns.net\/v1\/static\/62009828001\/58872e10-c2df-483c-9438-500e097f445d\/a9ff03d6-4294-40f9-89cd-8a3b1c746e19\/160x90\/match\/image.jpg\" onError=\"this.style.display ='none';\"\/>\n      <div class=\"overlay_container\">\n      <span class=\"icon-video icon_color_null\"><time class=\"video_length\">4:54<\/time><\/span>\n      <\/div>\n      <\/a><\/div><p>I have been reading the MATLAB questions in Stack Overflow for a few weeks, and here was a really good question that came through.\r\n\r\nWith two vectors, x and y, bin the x values as if with a&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/videos\/2009\/01\/07\/binning-data-in-matlab\/\">read more >><\/a><\/p>","protected":false},"author":68,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,17,20],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/347"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/comments?post=347"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/347\/revisions"}],"predecessor-version":[{"id":2098,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/347\/revisions\/2098"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/media?parent=347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/categories?post=347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/tags?post=347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}