{"id":6125,"date":"2015-08-14T09:00:58","date_gmt":"2015-08-14T13:00:58","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=6125"},"modified":"2015-08-12T19:49:38","modified_gmt":"2015-08-12T23:49:38","slug":"geom-2d","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2015\/08\/14\/geom-2d\/","title":{"rendered":"Geom 2d"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction>\r\n      <p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3208495\">Sean<\/a>'s pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/7844-geom2d\">geom2d<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/127343\">David Legland<\/a>.\r\n      <\/p>\r\n   <\/introduction>\r\n\r\n   <p>Working at MathWorks, I get to use MATLAB every day, learn a lot about it, and get to try everything.  But one of the things\r\n      I forget is the experience of someone who doesn't use it every day but occasionally needs it for a specific task.  Thus, when\r\n      I get the opportunity to solve a problem like this, it reminds me of my early days and reminds me what a privilege it is to\r\n      have access to professional quality software.\r\n   <\/p>\r\n   <p>Yesterday, one of our program managers came to my office and wanted me to create a map of the United States for her with different\r\n      regions color coded.  Seems straight forward right?  Here's the story of the steps I took to create the map for her.\r\n   <\/p>\r\n   <p>I knew off the top of my head, that <a href=\"\"><tt>usamap<\/tt><\/a> in the <a href=\"https:\/\/www.mathworks.com\/products\/mapping\/\">Mapping Toolbox<\/a> was the function that I needed to build the map.  So I went to the doc page linked above by running:\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">doc <span style=\"color: #A020F0\">usamap<\/span><\/pre><p>The third example at the bottom of the doc page was exactly what I was looking for.  I almost always start with examples because\r\n      it's easier to modify or delete than to add.  As an added bonus, it already even excluded Alaska and Hawaii which she didn't\r\n      want on her map!\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/maingeom2d\/docusamap.png\"> <\/p>\r\n   <p>I copied this example in, and ran it.  I quickly realized that the line I really needed to modify was the following one; it\r\n      even had a nice comment noting the current randomness.\r\n   <\/p><pre>faceColors = makesymbolspec('Polygon',...\r\n   {'INDEX', [1 numel(states)], 'FaceColor', ...\r\n   polcmap(numel(states))}); %NOTE - colors are random<\/pre><p>I figured <tt>polcmap<\/tt> probably worked like any of the other colormap functions and takes the number of unique colors to make.  My task involved\r\n      six regions and so I needed six colors.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">figure\r\npolcmap6 = polcmap(6);\r\ncolormap(polcmap6)\r\ncolorbar<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/maingeom2d\/maingeom2d_01.png\"> <p>Minor victory!<\/p>\r\n   <p>Now I needed to index into this colormap each state's region.  I asked for an Excel sheet containing the states and the region\r\n      indices.\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/maingeom2d\/stateregions.png\"> <\/p>\r\n   <p>This can be easily read in with <a href=\"\"><tt>readtable<\/tt><\/a>.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">Tstateregions = readtable(<span style=\"color: #A020F0\">'StateRegionsLookup.xlsx'<\/span>);<\/pre><pre style=\"font-style:oblique\">Warning: Variable names were modified to make\r\nthem valid MATLAB identifiers. \r\n<\/pre><p>With the region indices, I should be able to plot the map color coded by indexing into the colormap:<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">figure\r\nax = usamap(<span style=\"color: #A020F0\">'conus'<\/span>);\r\n\r\nstates = shaperead(<span style=\"color: #A020F0\">'usastatelo'<\/span>, <span style=\"color: #A020F0\">'UseGeoCoords'<\/span>, true,<span style=\"color: #0000FF\">...<\/span>\r\n  <span style=\"color: #A020F0\">'Selector'<\/span>,<span style=\"color: #0000FF\">...<\/span>\r\n  {@(name) ~any(strcmp(name,{<span style=\"color: #A020F0\">'Alaska'<\/span>,<span style=\"color: #A020F0\">'Hawaii'<\/span>})), <span style=\"color: #A020F0\">'Name'<\/span>});\r\n\r\nfaceColors = makesymbolspec(<span style=\"color: #A020F0\">'Polygon'<\/span>,<span style=\"color: #0000FF\">...<\/span>\r\n    {<span style=\"color: #A020F0\">'INDEX'<\/span>, [1 numel(states)], <span style=\"color: #A020F0\">'FaceColor'<\/span>, <span style=\"color: #0000FF\">...<\/span>\r\n    polcmap6(Tstateregions.Region,:)});\r\n\r\ngeoshow(ax, states, <span style=\"color: #A020F0\">'DisplayType'<\/span>, <span style=\"color: #A020F0\">'polygon'<\/span>, <span style=\"color: #0000FF\">...<\/span>\r\n   <span style=\"color: #A020F0\">'SymbolSpec'<\/span>, faceColors)\r\n\r\n\r\nframem <span style=\"color: #A020F0\">off<\/span>\r\ngridm <span style=\"color: #A020F0\">off<\/span>\r\nmlabel <span style=\"color: #A020F0\">off<\/span>\r\nplabel <span style=\"color: #A020F0\">off<\/span><\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/maingeom2d\/maingeom2d_02.png\"> <p>But that doesn't look right!  So what went wrong, I took a look at the states and compared them:<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">table({states(:).Name}.', Tstateregions.State,<span style=\"color: #A020F0\">'VariableNames'<\/span>,{<span style=\"color: #A020F0\">'MATLAB'<\/span>,<span style=\"color: #A020F0\">'Excel'<\/span>})<\/pre><pre style=\"font-style:oblique\">ans = \r\n            MATLAB                     Excel          \r\n    ______________________    ________________________\r\n    'Alabama'                 ''Alabama''             \r\n    'Arizona'                 ''Arizona''             \r\n    'Arkansas'                ''Arkansas''            \r\n    'California'              ''California''          \r\n    'Colorado'                ''Colorado''            \r\n    'Connecticut'             ''Connecticut''         \r\n    'Delaware'                ''Delaware''            \r\n    'Florida'                 ''District of Columbia''\r\n    'Georgia'                 ''Florida''             \r\n    'Idaho'                   ''Georgia''             \r\n    'Illinois'                ''Idaho''               \r\n    'Indiana'                 ''Illinois''            \r\n    'Iowa'                    ''Indiana''             \r\n    'Kansas'                  ''Iowa''                \r\n    'Kentucky'                ''Kansas''              \r\n    'Louisiana'               ''Kentucky''            \r\n    'Maine'                   ''Louisiana''           \r\n    'Maryland'                ''Maine''               \r\n    'Massachusetts'           ''Maryland''            \r\n    'Michigan'                ''Massachusetts''       \r\n    'Minnesota'               ''Michigan''            \r\n    'Mississippi'             ''Minnesota''           \r\n    'Missouri'                ''Mississippi''         \r\n    'Montana'                 ''Missouri''            \r\n    'Nebraska'                ''Montana''             \r\n    'Nevada'                  ''Nebraska''            \r\n    'New Hampshire'           ''Nevada''              \r\n    'New Jersey'              ''New Hampshire''       \r\n    'New Mexico'              ''New Jersey''          \r\n    'New York'                ''New Mexico''          \r\n    'North Carolina'          ''New York''            \r\n    'North Dakota'            ''North Carolina''      \r\n    'Ohio'                    ''North Dakota''        \r\n    'Oklahoma'                ''Ohio''                \r\n    'Oregon'                  ''Oklahoma''            \r\n    'Pennsylvania'            ''Oregon''              \r\n    'Rhode Island'            ''Pennsylvania''        \r\n    'South Carolina'          ''Rhode Island''        \r\n    'South Dakota'            ''South Carolina''      \r\n    'Tennessee'               ''South Dakota''        \r\n    'Texas'                   ''Tennessee''           \r\n    'Utah'                    ''Texas''               \r\n    'Vermont'                 ''Utah''                \r\n    'Virginia'                ''Vermont''             \r\n    'Washington'              ''Virginia''            \r\n    'West Virginia'           ''Washington''          \r\n    'Wisconsin'               ''West Virginia''       \r\n    'Wyoming'                 ''Wisconsin''           \r\n    'District of Columbia'    ''Wyoming''             \r\n<\/pre><p>Ahh ha!  Washington DC is appended to the end of MATLAB's shipping state border file where as it's alphabetical in the Excel\r\n      sheet causing an offset.  Simple enough manual fix:\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">Tstateregions = [Tstateregions([1:7 9:end],:); Tstateregions(8,:)];<\/pre><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">figure\r\nax = usamap(<span style=\"color: #A020F0\">'conus'<\/span>);\r\n\r\nfaceColors = makesymbolspec(<span style=\"color: #A020F0\">'Polygon'<\/span>,<span style=\"color: #0000FF\">...<\/span>\r\n    {<span style=\"color: #A020F0\">'INDEX'<\/span>, [1 numel(states)], <span style=\"color: #A020F0\">'FaceColor'<\/span>, <span style=\"color: #0000FF\">...<\/span>\r\n    polcmap6(Tstateregions.Region,:)});\r\n\r\ngeoshow(ax, states, <span style=\"color: #A020F0\">'DisplayType'<\/span>, <span style=\"color: #A020F0\">'polygon'<\/span>, <span style=\"color: #0000FF\">...<\/span>\r\n   <span style=\"color: #A020F0\">'SymbolSpec'<\/span>, faceColors)\r\n\r\n\r\nframem <span style=\"color: #A020F0\">off<\/span>\r\ngridm <span style=\"color: #A020F0\">off<\/span>\r\nmlabel <span style=\"color: #A020F0\">off<\/span>\r\nplabel <span style=\"color: #A020F0\">off<\/span><\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/maingeom2d\/maingeom2d_03.png\"> <p>By now you're probably wondering what this has to do with <tt>geom2d<\/tt>.  Well I still had to put the two letter code on each state.  To do this I needed a way to identify the centroid of the polygon.\r\n       I went to the File Exchange and searched for \"polygon centroid\", and sure enough <tt>geom2d<\/tt> has a function named exactly that!\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\"><span style=\"color: #0000FF\">for<\/span> ii = 1:numel(states)\r\n    latii = states(ii).Lat; <span style=\"color: #228B22\">% Remove nans indicating end of border<\/span>\r\n    lonii = states(ii).Lon;\r\n    cent = polygonCentroid(latii(~isnan(latii)),lonii(~isnan(lonii)));\r\n    textm(cent(1),cent(2),Tstateregions.x2letter(ii))\r\n<span style=\"color: #0000FF\">end<\/span><\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/maingeom2d\/maingeom2d_04.png\"> <p>And there you have it.<\/p>\r\n   <p>The polygon centroid function is just one of dozens in this well documented and organized toolbox.  There are tools for all\r\n      sorts of math, aggregation and plotting of geometric primitives, e.g. polygons, lines, rays, and polynomial curves.  Each\r\n      group of functions has its own <i>Contents.m<\/i> file so one can quickly see all of the functions and a quick description of what they do.  The functions have a full help\r\n      description, many with an example.  There are also a bunch of example files that have been published so you can see the example\r\n      without having to run it. Overall this is a great package to have around and now it can join its older brother, <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/24484-geom3d\"><tt>geom3d<\/tt><\/a> with a Pick of the Week banner!\r\n   <\/p>\r\n   <h3>Comments<a name=\"10\"><\/a><\/h3>\r\n   <p>Do you ever get a random one-off task or activity that is quickly solvable in MATLAB and that makes you feel good?<\/p>\r\n   <p>Give it a try and let us know what you think <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=6125#respond\">here<\/a> or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/7844-geom2d#comments\">comment<\/a> for David.\r\n   <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_762ba883ce1d4cce95bfb23a20732a3f() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='762ba883ce1d4cce95bfb23a20732a3f ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 762ba883ce1d4cce95bfb23a20732a3f';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Sean de Wolski';\r\n        copyright = 'Copyright 2015 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_762ba883ce1d4cce95bfb23a20732a3f()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2015b<br><\/p>\r\n<\/div>\r\n<!--\r\n762ba883ce1d4cce95bfb23a20732a3f ##### SOURCE BEGIN #####\r\n%% Geom2d\r\n%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3208495 Sean>'s pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/7844-geom2d geom2d> by\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/127343 David Legland>.\r\n% \r\n\r\n%% \r\n%\r\n% Working at MathWorks, I get to use MATLAB every day, learn a lot about\r\n% it, and get to try everything.  But one of the things I forget is the\r\n% experience of someone who doesn't use it every day but occasionally needs\r\n% it for a specific task.  Thus, when I get the opportunity to solve a\r\n% problem like this, it reminds me of my early days and reminds me what a\r\n% privilege it is to have access to professional quality software.\r\n%\r\n% Yesterday, one of our program managers came to my office and wanted me to\r\n% create a map of the United States for her with different regions color\r\n% coded.  Seems straight forward right?  Here's the story of the steps I\r\n% took to create the map for her.\r\n%\r\n% I knew off the top of my head, that\r\n% <\r\n% |usamap|> in the <https:\/\/www.mathworks.com\/products\/mapping\/ Mapping\r\n% Toolbox> was the function that I needed to build the map.  So I went to\r\n% the doc page linked above by running:\r\n%\r\n%   doc usamap\r\n%\r\n% The third example at the bottom of the doc page was exactly what I was\r\n% looking for.  I almost always start with examples because it's easier to\r\n% modify or delete than to add.  As an added bonus, it already even\r\n% excluded Alaska and Hawaii which she didn't want on her map!\r\n%\r\n% <<docusamap.png>>\r\n%\r\n% I copied this example in, and ran it.  I quickly realized that the line\r\n% I really needed to modify was the following one; it even had a nice\r\n% comment noting the current randomness.\r\n%\r\n%  faceColors = makesymbolspec('Polygon',...\r\n%     {'INDEX', [1 numel(states)], 'FaceColor', ... \r\n%     polcmap(numel(states))}); %NOTE - colors are random\r\n\r\n%%\r\n%\r\n% I figured |polcmap| probably worked like any of the other colormap\r\n% functions and takes the number of unique colors to make.  My task\r\n% involved six regions and so I needed six colors.\r\n\r\nfigure\r\npolcmap6 = polcmap(6);\r\ncolormap(polcmap6)\r\ncolorbar\r\n\r\n%% \r\n% Minor victory!\r\n%\r\n% Now I needed to index into this colormap each state's region.  I asked\r\n% for an Excel sheet containing the states and the region indices.\r\n%\r\n% <<stateregions.png>>\r\n%\r\n% This can be easily read in with\r\n% <\r\n% |readtable|>.\r\n\r\nTstateregions = readtable('StateRegionsLookup.xlsx');\r\n\r\n%% \r\n% With the region indices, I should be able to plot the map color coded by\r\n% indexing into the colormap:\r\n\r\nfigure\r\nax = usamap('conus');\r\n\r\nstates = shaperead('usastatelo', 'UseGeoCoords', true,...\r\n  'Selector',...\r\n  {@(name) ~any(strcmp(name,{'Alaska','Hawaii'})), 'Name'});\r\n\r\nfaceColors = makesymbolspec('Polygon',...\r\n    {'INDEX', [1 numel(states)], 'FaceColor', ... \r\n    polcmap6(Tstateregions.Region,:)});\r\n\r\ngeoshow(ax, states, 'DisplayType', 'polygon', ...\r\n   'SymbolSpec', faceColors)\r\n\r\n\r\nframem off\r\ngridm off\r\nmlabel off\r\nplabel off\r\n\r\n%% \r\n% But that doesn't look right!  So what went wrong, I took a look at the\r\n% states and compared them:\r\n%\r\n\r\ntable({states(:).Name}.', Tstateregions.State,'VariableNames',{'MATLAB','Excel'})\r\n\r\n\r\n%%\r\n% Ahh ha!  Washington DC is appended to the end of MATLAB's shipping state\r\n% border file where as it's alphabetical in the Excel sheet causing an\r\n% offset.  Simple enough manual fix:\r\n\r\nTstateregions = [Tstateregions([1:7 9:end],:); Tstateregions(8,:)];\r\n\r\n%%\r\n\r\nfigure\r\nax = usamap('conus');\r\n\r\nfaceColors = makesymbolspec('Polygon',...\r\n    {'INDEX', [1 numel(states)], 'FaceColor', ... \r\n    polcmap6(Tstateregions.Region,:)});\r\n\r\ngeoshow(ax, states, 'DisplayType', 'polygon', ...\r\n   'SymbolSpec', faceColors)\r\n\r\n\r\nframem off\r\ngridm off\r\nmlabel off\r\nplabel off\r\n\r\n%% \r\n% By now you're probably wondering what this has to do with |geom2d|.  Well\r\n% I still had to put the two letter code on each state.  To do this I\r\n% needed a way to identify the centroid of the polygon.  I went to the File\r\n% Exchange and searched for \"polygon centroid\", and sure enough |geom2d| has\r\n% a function named exactly that!\r\n\r\nfor ii = 1:numel(states)\r\n    latii = states(ii).Lat; % Remove nans indicating end of border\r\n    lonii = states(ii).Lon;\r\n    cent = polygonCentroid(latii(~isnan(latii)),lonii(~isnan(lonii)));    \r\n    textm(cent(1),cent(2),Tstateregions.x2letter(ii))\r\nend\r\n\r\n\r\n%% \r\n% And there you have it.  \r\n%\r\n% The polygon centroid function is just one of dozens in this well\r\n% documented and organized toolbox.  There are tools for all sorts of math,\r\n% aggregation and plotting of geometric primitives, e.g. polygons, lines,\r\n% rays, and polynomial curves.  Each group of functions has its own\r\n% _Contents.m_ file so one can quickly see all of the functions and a quick\r\n% description of what they do.  The functions have a full help description,\r\n% many with an example.  There are also a bunch of example files that have\r\n% been published so you can see the example without having to run it.\r\n% Overall this is a great package to have around and now it can join its\r\n% older brother,\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/24484-geom3d\r\n% |geom3d|> with a Pick of the Week banner!\r\n\r\n\r\n%% Comments\r\n% \r\n% Do you ever get a random one-off task or activity that is quickly\r\n% solvable in MATLAB and that makes you feel good? \r\n%\r\n% Give it a try and let us know what you think\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=6125#respond here> or leave a\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/7844-geom2d#comments\r\n% comment> for David.\r\n%\r\n \r\n\r\n##### SOURCE END ##### 762ba883ce1d4cce95bfb23a20732a3f\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/maingeom2d\/docusamap.png\" onError=\"this.style.display ='none';\" \/><\/div><p>\r\n   \r\n      Sean's pick this week is geom2d by David Legland.\r\n      \r\n   \r\n\r\n   Working at MathWorks, I get to use MATLAB every day, learn a lot about it, and get to try everything.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2015\/08\/14\/geom-2d\/\">read more >><\/a><\/p>","protected":false},"author":87,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/6125"}],"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\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=6125"}],"version-history":[{"count":4,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/6125\/revisions"}],"predecessor-version":[{"id":6129,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/6125\/revisions\/6129"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=6125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=6125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=6125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}