{"id":1874,"date":"2006-03-29T04:08:14","date_gmt":"2006-03-29T09:08:14","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=1874"},"modified":"2022-05-29T20:14:38","modified_gmt":"2022-05-30T00:14:38","slug":"linearly-space-matrix","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2006\/03\/29\/linearly-space-matrix\/","title":{"rendered":"Linearly space matrix"},"content":{"rendered":"<p><div class=\"alert alert-info\"> <span class=\"alert_icon icon-alert-info-reverse\"><\/span><p class=\"alert_heading\"><strong>Note<\/strong><\/p><p>The file submission referenced in this post is no longer available on File Exchange.<\/p><\/div><br \/>\nThis week&#8217;s guest pick of the week comes from Brett Shoelson of CSSM fame and one of the newer Language of Technical Computing <a href=\"https:\/\/www.mathworks.com\/company\/jobs\/opportunities\/ApplicationEngineering.html\">Applications Engineers<\/a> here at The Mathworks.  Applications Engineers present a lot of live seminars, maybe you can meet Brett at his next event and ask him some really tough questions!<\/p>\n<blockquote><p>Let\u2019s say that you wanted to create a linearly spaced vector of elements ranging from scalar x1 to scalar x2; MATLAB\u2019s own linspace.m function was built for that purpose, and makes it a trivial problem. But what if instead you wanted to step from vector X1 to (same-sized) vector X2 in a given number of steps? Or more dauntingly, consider the task of uniformly incrementing the elements of N-dimensional matrix M1 to the equal-sized matrix M2 in a specified number of steps. Certainly there are several ways to approach the problem, but none is particularly easy. Until, that is, you download Duane Hanselman\u2019s linspacen, which, with some very nice code, makes short work of the problem. Duane has also provided the functionality to step logarithmically in N dimensions, expanding the functionality of MATLAB\u2019s logspace function. The pair, linspacen and logspacen, together comprise this week\u2019s Pick of the Week.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p> NoteThe file submission referenced in this post is no longer available on File Exchange.<br \/>\nThis week&#8217;s guest pick of the week comes from Brett Shoelson of CSSM fame and one of the newer Language&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2006\/03\/29\/linearly-space-matrix\/\">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":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/1874"}],"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=1874"}],"version-history":[{"count":3,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/1874\/revisions"}],"predecessor-version":[{"id":15968,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/1874\/revisions\/15968"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=1874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=1874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=1874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}