{"id":1934,"date":"2012-01-27T23:33:58","date_gmt":"2012-01-28T04:33:58","guid":{"rendered":"http:\/\/labrigger.com\/blog\/?p=1934"},"modified":"2012-01-27T23:33:58","modified_gmt":"2012-01-28T04:33:58","slug":"matlab-command-locateval","status":"publish","type":"post","link":"http:\/\/labrigger.com\/blog\/2012\/01\/27\/matlab-command-locateval\/","title":{"rendered":"MATLAB command locateVal"},"content":{"rendered":"<p>In two previous posts I shared some MATLAB code to help design collection optics in 2p scopes.<br \/>\n<a href=\"http:\/\/labrigger.com\/blog\/2011\/02\/26\/matlab-code-for-designing-collection-optics-for-2p-scopes\/\">Collection optics for 2p scopes, post 1<\/a><br \/>\n<a href=\"http:\/\/labrigger.com\/blog\/2011\/03\/03\/more-matlab-code-for-2p-scope-design\/\">Collection optics for 2p scopes, post 2<\/a><br \/>\nIt was just brought to my attention that I didn&#8217;t include the command <strong>locateVal<\/strong> in the code I posted. It&#8217;s a very simple little shortcut I use. Here it is:<br \/>\n<font size=2><\/p>\n<pre>\r\nfunction [pos difference] = locateVal(val,data)\r\n[difference pos] = min(abs(data - val));\r\n<\/pre>\n<p><\/font><br \/>\nYes, you could have guessed that. But I wanted to correct the oversight.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In two previous posts I shared some MATLAB code to help design collection optics in 2p scopes.<br \/>\n<a href=\"http:\/\/labrigger.com\/blog\/2011\/02\/26\/matlab-code-for-designing-collection-optics-for-2p-scopes\/\">Collection optics for 2p scopes, post 1<\/a><br \/>\n<a href=\"http:\/\/labrigger.com\/blog\/2011\/03\/03\/more-matlab-code-for-2p-scope-design\/\">Collection optics for 2p scopes, post 2<\/a><br \/>\nIt was just brought to my attention that I didn&#8217;t include the command <strong>locateVal<\/strong> in the code I posted. It&#8217;s a very&#8230;<\/p>\n<div class=\"read-more\"><a href=\"http:\/\/labrigger.com\/blog\/2012\/01\/27\/matlab-command-locateval\/\">Read More<\/a><\/div><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[21,26],"class_list":["post-1934","post","type-post","status-publish","format-standard","hentry","category-software","tag-imaging","tag-matlab"],"_links":{"self":[{"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/posts\/1934","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/comments?post=1934"}],"version-history":[{"count":3,"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/posts\/1934\/revisions"}],"predecessor-version":[{"id":1937,"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/posts\/1934\/revisions\/1937"}],"wp:attachment":[{"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/media?parent=1934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/categories?post=1934"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/tags?post=1934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}