{"id":581,"date":"2017-09-14T13:43:20","date_gmt":"2017-09-14T16:43:20","guid":{"rendered":"http:\/\/www.professores.uff.br\/diomarcesarlobao\/?page_id=581"},"modified":"2017-09-14T13:43:20","modified_gmt":"2017-09-14T16:43:20","slug":"viewdir-m","status":"publish","type":"page","link":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/viewdir-m\/","title":{"rendered":"viewdir.m"},"content":{"rendered":"<pre>% Run this script after creating a 3D plot and it will \r\n% pop up a couple of sliders to allow changing the viewpoint.\r\n%\r\n% See the MATLAB function 'uicontrol'\r\n%\r\n% This routine is supplied without warrantee or support!\r\n\r\nfig = gcf;\r\n\r\n\r\nsli_azm = uicontrol(fig, 'Style', 'slider', ...\r\n\t'Position', [40 10 120 20], ...\r\n\t'Min', -180, 'Max', 180, 'Value', 30, ...\r\n\t'Callback', [ ...\r\n\t'set(azm_cur,''String'',',...\r\n\t\t'num2str(get(sli_azm,''Val''))),',...\r\n\t'set(gca,''View'',',...\r\n\t'[get(sli_azm,''Val''),get(sli_elv,''Val'')])']);\r\n\r\nsli_elv = uicontrol(fig, 'Style', 'slider', ...\r\n\t'Position', [230 10 120 20], ...\r\n\t'Min', -90, 'Max', 90, 'Value', 30, ...\r\n\t'Callback', [ ...\r\n\t'set(elv_cur,''String'',',...\r\n\t\t'num2str(get(sli_elv,''Val''))),',...\r\n\t'set(gca,''View'',',...\r\n\t'[get(sli_azm,''Val''),get(sli_elv,''Val'')])']);\r\n\r\nazm_min = uicontrol(fig,...\r\n\t'Style', 'text', ...\r\n\t'Pos', [10 10 30 20], ...\r\n        'BackGroundColor',[0 1 0],...\r\n\t'String', num2str(get(sli_azm, 'Min')));\r\n\r\nelv_min = uicontrol(fig,...\r\n\t'Style', 'text', ...\r\n\t'Pos', [200 10 30 20], ...\r\n        'BackGroundColor',[0 1 1],...\r\n\t'String', num2str(get(sli_elv, 'Min')));\r\n\r\nazm_max = uicontrol(fig,...\r\n\t'Style', 'text', ...\r\n\t'Pos', [160 10 30 20], ...\r\n        'BackGroundColor',[0 1 0],...\r\n\t'String', num2str(get(sli_azm, 'Max')));\r\n\r\nelv_max = uicontrol(fig,...\r\n\t'Style', 'text', ...\r\n\t'Pos', [350 10 30 20], ...\r\n        'BackGroundColor',[0 1 1],...\r\n\t'String', num2str(get(sli_elv, 'Max')));\r\n\r\nazm_label = uicontrol(fig, ...\r\n\t'Style', 'text', ...\r\n\t'Pos', [40 40 65 20], ...\r\n        'BackGroundColor',[0 1 0],...\r\n\t'String', 'Azimuth');\r\n\r\nelv_label = uicontrol(fig, ...\r\n\t'Style', 'text', ...\r\n\t'Pos', [230 40 65 20], ...\r\n        'BackGroundColor',[0 1 1],...\r\n\t'String', 'Elevation');\r\n\r\nazm_cur = uicontrol(fig, ...\r\n\t'Style', 'text', ...\r\n\t'Pos', [110 40 50 20], ...\r\n        'BackGroundColor',[0 1 0],...\r\n\t'String', num2str(get(sli_azm, 'Value')));\r\n\r\nelv_cur = uicontrol(fig, ...\r\n\t'Style', 'text', ...\r\n\t'Pos', [300 40 50 20], ...\r\n        'BackGroundColor',[0 1 1],...\r\n\t'String', num2str(get(sli_elv, 'Value')));<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>% Run this script after creating a 3D plot and it will % pop up a couple of sliders to allow changing the viewpoint. % % See the MATLAB function &#8216;uicontrol&#8217; % % This routine is supplied without warrantee or support! fig = gcf; sli_azm = uicontrol(fig, &#8216;Style&#8217;, &#8216;slider&#8217;, &#8230; &#8216;Position&#8217;, [40 10 120 20], [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[],"tags":[],"class_list":["post-581","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/581","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/comments?post=581"}],"version-history":[{"count":1,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/581\/revisions"}],"predecessor-version":[{"id":582,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/581\/revisions\/582"}],"wp:attachment":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/media?parent=581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/categories?post=581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/tags?post=581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}