{"id":2075,"date":"2007-11-15T14:57:29","date_gmt":"2007-11-15T19:57:29","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2007\/11\/15\/practical-example-algorithm-development-for-making-colormaps\/"},"modified":"2016-05-18T16:45:47","modified_gmt":"2016-05-18T20:45:47","slug":"practical-example-algorithm-development-for-making-colormaps","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2007\/11\/15\/practical-example-algorithm-development-for-making-colormaps\/","title":{"rendered":"Practical example: Algorithm development for making colormaps"},"content":{"rendered":"<p>In a recent post, I mentioned <a href=\"https:\/\/blogs.mathworks.com\/pick\/2007\/11\/13\/lazyweb-on-the-file-exchange\/\">LazyWeb<\/a> It worked better than I expected. Matt <a title=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadFile.do?objectId=17505&#038;objectType=FILE (link no longer works)\">posted some code<\/a> that I requested that will highlight a line when you click on it. This works exactly as hoped. Thanks Matt, your MATLAB T-shirt has been shipped to thank you for your effort.<\/p>\n<p>Ned thought this was great, so he <a href=\"https:\/\/blogs.mathworks.com\/pick\/2007\/11\/13\/lazyweb-on-the-file-exchange\/#comments\">posted a request<\/a> for some code that makes colormaps.<\/p>\n<p>I took up the challenge, mostly so that I could record how I went about developing an algorithm.<\/p>\n<p>I broke this into two videos:<\/p>\n<p>In this first video you will see:<\/p>\n<ul>\n<li>The colormaps that we are developing from a journal article<\/li>\n<li>The colormap applied to a MATLAB figure<\/li>\n<li>How to call the code to make the colormap<\/li>\n<li>Explaining the structure of a colormap in MATLAB<\/li>\n<li>Exploring colormaps in the colormap editor<\/li>\n<li>Plotting a colormap to understand its structure<\/li>\n<li>Creating the colormap creating subfunction<\/li>\n<li>Testing the subfunction<\/li>\n<\/ul>\n<p><embed src=\"https:\/\/blogs.mathworks.com\/images\/pick\/\/FlashVideos\/FlowPlayer.swf?config=%7Bembedded%3Atrue%2CplayList%3A%5B%7BsuggestedClipsInfoUrl%3A%2750%20see%20also%2Etxt%27%2Curl%3A%2750%20Practical%20Make%20colormap%2Eflv%27%7D%5D%2CbaseURL%3A%27http%3A%2F%2Fblogs%2Emathworks%2Ecom%2Fimages%2Fpick%2FFlashVideos%2F%27%2CsplashImageFile%3A%2750%20Practical%20Make%20colormap%2Ejpg%27%2Cloop%3Afalse%2CinitialScale%3A%27fit%27%2CshowFullScreenButton%3Afalse%2CautoBuffering%3Afalse%2CmenuItems%3A%5Bfalse%2Cfalse%2Cfalse%2Cfalse%2Cfalse%2Ctrue%5D%2CautoPlay%3Afalse%7D\" type=\"application\/x-shockwave-flash\" width=\"500\" height=\"400\"><\/embed><\/p>\n<p>In this second video you will see:<\/p>\n<ul>\n<li>We review the colormaps that are to be made.<\/li>\n<li>Show the four expected calling syntaxes for the function<\/li>\n<li>Show how to use VARARGIN to make deal with different numbers of input arguments<\/li>\n<li>Show error catching<\/li>\n<li>Show different branches of code to be followed based on inputs<\/li>\n<li>Developing an algorithm with cell mode to test an algorithm<\/li>\n<li>Testing<\/li>\n<li>Documentation<\/li>\n<\/ul>\n<p><embed src=\"https:\/\/blogs.mathworks.com\/images\/pick\/\/FlashVideos\/FlowPlayer.swf?config=%7Bembedded%3Atrue%2CplayList%3A%5B%7BsuggestedClipsInfoUrl%3A%2751%20see%20also%2Etxt%27%2Curl%3A%2751%20Practical%20Make%20colormap%202%2Eflv%27%7D%5D%2CbaseURL%3A%27http%3A%2F%2Fblogs%2Emathworks%2Ecom%2Fimages%2Fpick%2FFlashVideos%2F%27%2CsplashImageFile%3A%2751%20Practical%20Make%20colormap%202%2Ejpg%27%2Cloop%3Afalse%2CinitialScale%3A%27fit%27%2CshowFullScreenButton%3Afalse%2CautoBuffering%3Afalse%2CmenuItems%3A%5Bfalse%2Cfalse%2Cfalse%2Cfalse%2Cfalse%2Ctrue%5D%2CautoPlay%3Afalse%7D\" type=\"application\/x-shockwave-flash\" width=\"500\" height=\"400\"><\/embed><\/p>\n<p>&nbsp;<\/p>\n<p>This code was written live, so mistakes were made along the way. This gives you a realistic view of how a MATLAB expert deals with the inevitable errors that occur while programming.<\/p>\n<p>The file that got created is useful on its own, so I have posted it <a title=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadFile.do?objectId=17552&amp;objectType=FILE (link no longer works)\">here<\/a><\/p>\n<p>Other videos have been gathered here:<br \/>\n<a href=\"https:\/\/blogs.mathworks.com\/pick\/category\/video\/\">https:\/\/blogs.mathworks.com\/pick\/category\/video\/<\/a><\/p>\n<p>Practical example videos have been gathered here:<br \/>\n<a href=\"https:\/\/blogs.mathworks.com\/pick\/category\/practical-example\">https:\/\/blogs.mathworks.com\/pick\/category\/practical-example<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a recent post, I mentioned LazyWeb It worked better than I expected. Matt posted some code that I requested that will highlight a line when you click on it. This works exactly as hoped. Thanks&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2007\/11\/15\/practical-example-algorithm-development-for-making-colormaps\/\">read more >><\/a><\/p>\n","protected":false},"author":68,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,2],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2075"}],"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\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=2075"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2075\/revisions"}],"predecessor-version":[{"id":7372,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2075\/revisions\/7372"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}