{"id":65,"date":"2006-11-10T12:07:33","date_gmt":"2006-11-10T17:07:33","guid":{"rendered":"https:\/\/blogs.mathworks.com\/loren\/?p=65"},"modified":"2018-01-08T14:45:07","modified_gmt":"2018-01-08T19:45:07","slug":"all-about-the-colon-operator","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/loren\/2006\/11\/10\/all-about-the-colon-operator\/","title":{"rendered":"All about the Colon Operator"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction>\r\n      <p>I have written several blog articles that cover some aspects of the <tt>:<\/tt> operator.  Based on some recent posts to the <a>MATLAB newsgroup<\/a>, it seems worthwhile for me to compile the information.\r\n      <\/p>\r\n   <\/introduction>\r\n   <h3>Contents<\/h3>\r\n   <div>\r\n      <ul>\r\n         <li><a href=\"#1\">Uses of :<\/a><\/li>\r\n         <li><a href=\"#2\">Creating a List of Numbers<\/a><\/li>\r\n         <li><a href=\"#6\">Collapsing Trailing Dimensions<\/a><\/li>\r\n         <li><a href=\"#8\">Creating a Column Vector<\/a><\/li>\r\n         <li><a href=\"#10\">Retaining Array Shape During Assignment<\/a><\/li>\r\n         <li><a href=\"#12\">Working with All the Entries in Specified Dimensions<\/a><\/li>\r\n         <li><a href=\"#17\">Related Reference Material<\/a><\/li>\r\n         <li><a href=\"#19\">: is Complicated<\/a><\/li>\r\n      <\/ul>\r\n   <\/div>\r\n   <h3>Uses of :<a name=\"1\"><\/a><\/h3>\r\n   <p>There are several ways that you can use the <tt>:<\/tt> operator in MATLAB, and they serve different purposes.  Most, but not all of them, have to do with indexing into an array.\r\n   <\/p>\r\n   <div>\r\n      <ul>\r\n         <li>Creating a list of numbers<\/li>\r\n         <li>Collapsing trailing dimensions (right- or left-hand side)<\/li>\r\n         <li>Creating a column vector (right-hand side behavior related to <tt>reshape<\/tt>)\r\n         <\/li>\r\n         <li>Retaining an array shape during assignment (left-hand side behavior)<\/li>\r\n         <li>Working with all the entries in specified dimensions<\/li>\r\n      <\/ul>\r\n   <\/div>\r\n   <h3>Creating a List of Numbers<a name=\"2\"><\/a><\/h3>\r\n   <p>You can use the <tt>:<\/tt> operator to create a vector of evenly-spaced numbers.  Here are the integers from -3 to 3.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">list1 = -3:3<\/pre><pre style=\"font-style:oblique\">list1 =\r\n    -3    -2    -1     0     1     2     3\r\n<\/pre><p>Here are the first few odd positive integers.<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">list2 = 1:2:10<\/pre><pre style=\"font-style:oblique\">list2 =\r\n     1     3     5     7     9\r\n<\/pre><p>Here's how to divide the interval between 0 and <tt>pi<\/tt> into equally spaced samples.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">nsamp = 5;\r\nsliceOfPi = (0:1\/(nsamp-1):1)*pi<\/pre><pre style=\"font-style:oblique\">sliceOfPi =\r\n         0    0.7854    1.5708    2.3562    3.1416\r\n<\/pre><p>Note that even though only a few digits of each value in <tt>sliceOfPi<\/tt> are printed out, they are double precision numbers.  To see more digits, check out the function <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/format.html\"><tt>format<\/tt><\/a>.\r\n   <\/p>\r\n   <h3>Collapsing Trailing Dimensions<a name=\"6\"><\/a><\/h3>\r\n   <p>I have a 4-dimensional array and would like to find the sum of all the elements that are in the final row and column.<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">b = rand(3,2,6,4);\r\nb32sum = sum(b(3,2,:))<\/pre><pre style=\"font-style:oblique\">b32sum =\r\n   11.4622\r\n<\/pre><p>If instead, I sum using <b>all<\/b> the dimensions, in this case, I get a 1x1x1x4 array instead of scalar output.  If I sum these output values, I get my overall\r\n      sum.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">b32sumAll = sum(b(3,2,:,:))\r\noverall = sum(b32sumAll)<\/pre><pre style=\"font-style:oblique\">b32sumAll(:,:,1,1) =\r\n    2.8279\r\nb32sumAll(:,:,1,2) =\r\n    3.4177\r\nb32sumAll(:,:,1,3) =\r\n    1.9352\r\nb32sumAll(:,:,1,4) =\r\n    3.2815\r\noverall =\r\n   11.4622\r\n<\/pre><h3>Creating a Column Vector<a name=\"8\"><\/a><\/h3>\r\n   <p>Here's the size of the array <tt>b32sumAll<\/tt>.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">size(b32sumAll)<\/pre><pre style=\"font-style:oblique\">ans =\r\n     1     1     1     4\r\n<\/pre><p>If I want to transform this into a column vector, I can use <tt>reshape<\/tt>, <tt>permute<\/tt> or <tt>:<\/tt> on the right-hand side.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">b32vecR = reshape(b32sumAll,[],1);\r\nb32vecP = permute(b32sumAll, [4 1:3]);\r\nb32vec = b32sumAll(:)\r\nallthesame = isequal(b32vec, b32vecP, b32vecR)<\/pre><pre style=\"font-style:oblique\">b32vec =\r\n    2.8279\r\n    3.4177\r\n    1.9352\r\n    3.2815\r\nallthesame =\r\n     1\r\n<\/pre><h3>Retaining Array Shape During Assignment<a name=\"10\"><\/a><\/h3>\r\n   <p>Now let me pour some new values into <tt>b32sumAll<\/tt>, the array that looks almost like a vector.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">b32sumAll(:) = [1 2; 3 5]<\/pre><pre style=\"font-style:oblique\">b32sumAll(:,:,1,1) =\r\n     1\r\nb32sumAll(:,:,1,2) =\r\n     3\r\nb32sumAll(:,:,1,3) =\r\n     2\r\nb32sumAll(:,:,1,4) =\r\n     5\r\n<\/pre><p>Notice that I only have to have the same number of elements on both the left- and right-hand sides.  The values are poured\r\n      in from the right-hand side ordered as if that array had been turned into a column vector. Note that a scalar for the right-hand\r\n      side is also acceptable and then MATLAB performs a scalar expansion to fill the left-hand side.\r\n   <\/p>\r\n   <h3>Working with All the Entries in Specified Dimensions<a name=\"12\"><\/a><\/h3>\r\n   <p>If I want to manipulate values in some specific dimensions, I can also use the <tt>:<\/tt> operator to specify the dimensions I'd like to leave alone. For example, suppose I want to perform a left shift on the values\r\n      in the second dimension of my 3-D array.  Let me first create an array for illustration.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">a3 = zeros(2,3,2);\r\na3(:) = 1:numel(a3)<\/pre><pre style=\"font-style:oblique\">a3(:,:,1) =\r\n     1     3     5\r\n     2     4     6\r\na3(:,:,2) =\r\n     7     9    11\r\n     8    10    12\r\n<\/pre><p>Now let's shift the column values all over to the left, and have the right-most one become the last column.  Note that columns\r\n      are dimension 2. Here's a way to do this.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">a3r1 = a3(:,[2:size(a3,2) 1],:)<\/pre><pre style=\"font-style:oblique\">a3r1(:,:,1) =\r\n     3     5     1\r\n     4     6     2\r\na3r1(:,:,2) =\r\n     9    11     7\r\n    10    12     8\r\n<\/pre><p>How do I do this if the array could be any number of dimensions, not just 3?  I can't index with <tt>:<\/tt>, because I don't know how many <tt>:<\/tt> to use, since I don't knwo the dimension.  In this case, use the string value <tt>':'<\/tt>, create the indices in a cell array, and use the notion of the comma-separated list to perform the actual indexing.  For\r\n      <tt>a3<\/tt>, here's what this looks like.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">indices = {<span style=\"color: #A020F0\">':'<\/span>, [2:size(a3,2) 1],<span style=\"color: #A020F0\">':'<\/span>}\r\na3rnew = a3(indices{:})\r\nsameshifts = isequal(a3r1, a3rnew)<\/pre><pre style=\"font-style:oblique\">indices = \r\n    ':'    [1x3 double]    ':'\r\na3rnew(:,:,1) =\r\n     3     5     1\r\n     4     6     2\r\na3rnew(:,:,2) =\r\n     9    11     7\r\n    10    12     8\r\nsameshifts =\r\n     1\r\n<\/pre><p>Now, more generally, when the number of dimensions is not known, I simply create a cell array of all <tt>':'<\/tt> string values, replace the specific dimensions I care about with some other indexing expression, and then I can use the index\r\n      cell array to do the operation.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">a5 = zeros(2,5,2,3,4);\r\na5(:) = 1:numel(a5);\r\nindices = repmat({<span style=\"color: #A020F0\">':'<\/span>}, 1, ndims(a5));\r\nmyshift = [2:size(a5,2) 1]\r\nindices{2} = myshift\r\na5new = a5(indices{:});<\/pre><pre style=\"font-style:oblique\">myshift =\r\n     2     3     4     5     1\r\nindices = \r\n    ':'    [1x5 double]    ':'    ':'    ':'\r\n<\/pre><p>Let's compare two \"rows\" and see that the values have shifted left by 1 column.<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">a5(1,:,2,2,3)\r\na5new(1,:,2,2,3)<\/pre><pre style=\"font-style:oblique\">ans =\r\n   151   153   155   157   159\r\nans =\r\n   153   155   157   159   151\r\n<\/pre><h3>Related Reference Material<a name=\"17\"><\/a><\/h3>\r\n   <p>For more in depth understanding of the various ways in which the <tt>:<\/tt> operator can be used, look in the MATLAB documention\r\n   <\/p>\r\n   <div>\r\n      <ul>\r\n         <li><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/colon.html\"><tt>:<\/tt> operator<\/a><\/li>\r\n         <li><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/linspace.html\"><tt>linspace<\/tt><\/a><\/li>\r\n         <li><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/permute.html\"><tt>permute<\/tt><\/a><\/li>\r\n         <li><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/reshape.html\"><tt>reshape<\/tt><\/a><\/li>\r\n         <li><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/subsref.html\"><tt>subsref<\/tt><\/a><\/li>\r\n         <li><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/subsasgn.html\"><tt>subsasgn<\/tt><\/a><\/li>\r\n      <\/ul>\r\n   <\/div>\r\n   <p>and in related blog articles<\/p>\r\n   <div>\r\n      <ul>\r\n         <li><a href=\"https:\/\/blogs.mathworks.com\/loren\/?p=49\">Essence of Indexing<\/a><\/li>\r\n         <li><a href=\"https:\/\/blogs.mathworks.com\/loren\/?p=51\">A Glimpse into Floating-Point Accuracy<\/a><\/li>\r\n         <li><a href=\"https:\/\/blogs.mathworks.com\/loren\/?p=28\">Making Functions Suitable for ND Arrays<\/a><\/li>\r\n      <\/ul>\r\n   <\/div>\r\n   <h3>: is Complicated<a name=\"19\"><\/a><\/h3>\r\n   <p>The <tt>:<\/tt> operator behaves differently in MATLAB depending on its usage. This can lead to confusion.  Have I missed anything major\r\n      on this topic? Let me know.<\/p><script language=\"JavaScript\"> \r\n<!--\r\n    function grabCode_2100dee392274a928bbd7d368e522149() {\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='2100dee392274a928bbd7d368e522149 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 2100dee392274a928bbd7d368e522149';\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 = 'Loren Shure';\r\n        copyright = 'Copyright 2006 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      <\/script>\r\n<noscript>\r\n<em>A Javascript-enabled browser is required to use the \"Get the MATLAB code\" link.<\/em>\r\n<\/noscript>\r\n<p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_2100dee392274a928bbd7d368e522149()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code<\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.3<br><\/p>\r\n<\/div>\r\n<!--\r\n2100dee392274a928bbd7d368e522149 ##### SOURCE BEGIN #####\r\n%% All about the Colon Operator\r\n% I have written several blog articles that cover some aspects of the |:|\r\n% operator.  Based on some recent posts to the\r\n% <http:\/\/.html MATLAB newsgroup>, \r\n% it seems worthwhile for me to compile the information. \r\n%% Uses of :\r\n% There are several ways that you can use the |:| operator in MATLAB, and\r\n% they serve different purposes.  Most, but not all of them, have to do\r\n% with indexing into an array.\r\n%\r\n% * Creating a list of numbers\r\n% * Collapsing trailing dimensions (right- or left-hand side)\r\n% * Creating a column vector (right-hand side behavior related to |reshape|)\r\n% * Retaining an array shape during assignment (left-hand side behavior)\r\n% * Working with all the entries in specified dimensions\r\n%% Creating a List of Numbers\r\n% You can use the |:| operator to create a vector of evenly-spaced numbers.\r\n%  Here are the integers from -3 to 3.\r\nlist1 = -3:3\r\n%%\r\n% Here are the first few odd positive integers. \r\nlist2 = 1:2:10\r\n%%\r\n% Here's how to divide the interval between 0 and |pi| into equally\r\n% spaced samples.\r\nnsamp = 5;\r\nsliceOfPi = (0:1\/(nsamp-1):1)*pi\r\n%%\r\n% Note that even though only a few digits of each value in |sliceOfPi| are printed out,\r\n% they are double precision numbers.  To see more digits, check out the function \r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/format.html |format|>.\r\n%% Collapsing Trailing Dimensions\r\n% I have a 4-dimensional array and would like to find the sum of all the\r\n% elements that are in the final row and column.\r\nb = rand(3,2,6,4);\r\nb32sum = sum(b(3,2,:))\r\n%% \r\n% If instead, I sum using *all* the dimensions, in this case, I get a\r\n% 1x1x1x4 array instead of scalar output.  If I sum these output values, I\r\n% get my overall sum.\r\nb32sumAll = sum(b(3,2,:,:))\r\noverall = sum(b32sumAll)\r\n%% Creating a Column Vector\r\n% Here's the size of the array |b32sumAll|.\r\nsize(b32sumAll)\r\n%%\r\n% If I want to transform this into a column vector, I can use |reshape|, \r\n% |permute| or |:| on the right-hand side.\r\nb32vecR = reshape(b32sumAll,[],1);\r\nb32vecP = permute(b32sumAll, [4 1:3]);\r\nb32vec = b32sumAll(:)\r\nallthesame = isequal(b32vec, b32vecP, b32vecR)\r\n\r\n%% Retaining Array Shape During Assignment\r\n% Now let me pour some new values into |b32sumAll|, the array that looks\r\n% almost like a vector.\r\nb32sumAll(:) = [1 2; 3 5]\r\n%%\r\n% Notice that I only have to have the same number of elements on both the\r\n% left- and right-hand sides.  The values are poured in from the right-hand\r\n% side ordered as if that array had been turned into a column vector.\r\n% Note that a scalar for the right-hand side is\r\n% also acceptable and then MATLAB performs a scalar expansion to fill the\r\n% left-hand side.\r\n%% Working with All the Entries in Specified Dimensions\r\n% If I want to manipulate values in some specific dimensions, I can also\r\n% use the |:| operator to specify the dimensions I'd like to leave alone.\r\n% For example, suppose I want to perform a left shift on the values in\r\n% the second dimension of my 3-D array.  Let me first create an array for\r\n% illustration.\r\na3 = zeros(2,3,2);\r\na3(:) = 1:numel(a3)\r\n%%\r\n% Now let's shift the column values all over to the left, and have the\r\n% right-most one become the last column.  Note that columns are dimension 2.\r\n% Here's a way to do this.\r\na3r1 = a3(:,[2:size(a3,2) 1],:)\r\n%%\r\n% How do I do this if the array could be any number of dimensions, not just\r\n% 3?  I can't index with |:|, because I don't know how many |:| to use,\r\n% since I don't knwo the dimension.  In this case, use the string value\r\n% |':'|, create the indices in a cell array, and use the notion of the\r\n% comma-separated list to perform the actual indexing.  For |a3|, here's\r\n% what this looks like.\r\nindices = {':', [2:size(a3,2) 1],':'}\r\na3rnew = a3(indices{:})\r\nsameshifts = isequal(a3r1, a3rnew)\r\n%%\r\n% Now, more generally, when the number of dimensions is not known, I simply\r\n% create a cell array of all |':'| string values, replace the specific\r\n% dimensions I care about with some other indexing expression, and then I\r\n% can use the index cell array to do the operation.\r\na5 = zeros(2,5,2,3,4);\r\na5(:) = 1:numel(a5);\r\nindices = repmat({':'}, 1, ndims(a5));\r\nmyshift = [2:size(a5,2) 1]\r\nindices{2} = myshift\r\na5new = a5(indices{:});\r\n%% \r\n% Let's compare two \"rows\" and see that the values have shifted left by 1\r\n% column.\r\na5(1,:,2,2,3)\r\na5new(1,:,2,2,3)\r\n%% Related Reference Material\r\n% For more in depth understanding of the various ways in which the |:|\r\n% operator can be used, look in the MATLAB documention\r\n%\r\n% * <https:\/\/www.mathworks.com\/help\/matlab\/ref\/colon.html |:| operator>\r\n% * <https:\/\/www.mathworks.com\/help\/matlab\/ref\/linspace.html |linspace|>\r\n% * <https:\/\/www.mathworks.com\/help\/matlab\/ref\/permute.html |permute|>\r\n% * <https:\/\/www.mathworks.com\/help\/matlab\/ref\/reshape.html |reshape|>\r\n% * <https:\/\/www.mathworks.com\/help\/matlab\/ref\/subsref.html |subsref|>\r\n% * <https:\/\/www.mathworks.com\/help\/matlab\/ref\/subsasgn.html |subsasgn|>\r\n%\r\n%% \r\n% and in related blog articles\r\n%\r\n% * <https:\/\/blogs.mathworks.com\/loren\/?p=49 Essence of Indexing>\r\n% * <https:\/\/blogs.mathworks.com\/loren\/?p=51 A Glimpse into Floating-Point Accuracy>\r\n% * <https:\/\/blogs.mathworks.com\/loren\/?p=28 Making Functions Suitable for ND Arrays>\r\n%% : is Complicated\r\n% The |:| operator behaves differently in MATLAB depending on its usage.\r\n% This can lead to confusion.  Have I missed anything major on this topic?\r\n% <http:?p=65#respond Let me know.> \r\n##### SOURCE END ##### 2100dee392274a928bbd7d368e522149\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   \r\n      I have written several blog articles that cover some aspects of the : operator.  Based on some recent posts to the MATLAB newsgroup, it seems worthwhile for me to compile the... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/loren\/2006\/11\/10\/all-about-the-colon-operator\/\">read more >><\/a><\/p>","protected":false},"author":39,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[15],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/65"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/comments?post=65"}],"version-history":[{"count":2,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"predecessor-version":[{"id":2532,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/65\/revisions\/2532"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}