{"id":49,"date":"2006-08-09T13:58:04","date_gmt":"2006-08-09T18:58:04","guid":{"rendered":"https:\/\/blogs.mathworks.com\/loren\/?p=49"},"modified":"2016-07-28T16:44:44","modified_gmt":"2016-07-28T21:44:44","slug":"essence-of-indexing","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/loren\/2006\/08\/09\/essence-of-indexing\/","title":{"rendered":"Essence of Indexing"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction>\r\n      <p>Indexing into arrays allows you to address portions of the elements of an array and treat this subset as an array itself,\r\n         whether for calculations or input to other functions (essentially a right-hand side) or for assignment (left-hand side).\r\n      <\/p>\r\n   <\/introduction>\r\n   <h3>Contents<\/h3>\r\n   <div>\r\n      <ul>\r\n         <li><a href=\"#1\">Dimensions<\/a><\/li>\r\n         <li><a href=\"#2\">Right-Hand Side<\/a><\/li>\r\n         <li><a href=\"#14\">Left-Hand Side<\/a><\/li>\r\n         <li><a href=\"#20\">References<\/a><\/li>\r\n      <\/ul>\r\n   <\/div>\r\n   <h3>Dimensions<a name=\"1\"><\/a><\/h3>\r\n   <p>Arrays in MATLAB are N-dimensional, with an infinite number of trailing singleton dimensions.  Trailing singleton dimensions\r\n      past the second are not displayed or reported on, e.g., with <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/size.html\"><tt>size<\/tt><\/a>. No array has fewer than two dimensions.  Empty arrays are the logical extension of general arrays but have at least one\r\n      size 0 dimension. The syntax <tt>[]<\/tt> denotes the empty array of size <tt>0x0<\/tt> and is treated as an exception occasionally (for backward compatibility); it is also used specially during assignment.\r\n   <\/p>\r\n   <h3>Right-Hand Side<a name=\"2\"><\/a><\/h3>\r\n   <div>\r\n      <ul>\r\n         <li><b>General indexing on RHS<\/b> If <tt>A<\/tt> is an array with N dimensions of size <tt>[s1 s2 ... sN]<\/tt>, then a subset can be extracted by indexing with arrays of indices whos values lie between 1 and <tt>si<\/tt> for each dimension <tt>i = 1,...,N<\/tt>.  For dimensions starting from the right hand side that are scalar, their dimension is dropped from the result (e.g., for\r\n            <tt>size<\/tt>) and is implicitly 1 unless the dimension is <tt>&lt;=2<\/tt>.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">A = rand(2,3,2,1,1,1)\r\nndA = ndims(A)\r\nsizeA = size(A)\r\nB = A(1,2:3,2)\r\nsizeB = size(B)<\/pre><pre style=\"font-style:oblique\">A(:,:,1) =\r\n    0.2974    0.6932    0.9830\r\n    0.0492    0.6501    0.5527\r\nA(:,:,2) =\r\n    0.4001    0.6252    0.3759\r\n    0.1988    0.7334    0.0099\r\nndA =\r\n     3\r\nsizeA =\r\n     2     3     2\r\nB =\r\n    0.6252    0.3759\r\nsizeB =\r\n     1     2\r\n<\/pre><div>\r\n      <ul>\r\n         <li><b>Indexing with more indices than dimensions<\/b> If <tt>i&gt;N<\/tt> when indexing, the indices <tt>&gt;N<\/tt> must be 1, otherwise there will be an error.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">A(1,2,1,1)<\/pre><pre style=\"font-style:oblique\">ans =\r\n    0.6932\r\n<\/pre><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\"><span style=\"color: #0000FF\">try<\/span>\r\n    A(1,1,1,3)\r\n<span style=\"color: #0000FF\">catch<\/span>\r\n    s = lasterror();\r\n    s.message\r\n<span style=\"color: #0000FF\">end<\/span><\/pre><pre style=\"font-style:oblique\">ans =\r\nError using ==&gt; evalin\r\nIndex exceeds matrix dimensions.\r\n<\/pre><div>\r\n      <ul>\r\n         <li><b>Indexing with fewer indices than dimensions<\/b> If the final dimension <tt>i&lt;N<\/tt>, the right-hand dimensions collapse into the final dimension. E.g., if <tt>A = rand(1,3,4,1,7)<\/tt> and we type <tt>A(1,2,12)<\/tt>, then we get the element as if <tt>A<\/tt> were reshaped to <tt>A(1,3,28)<\/tt> and then indexed into.  28 repesents the product of the final size of the final dimension addressed and the other \"trailing\"\r\n            ones.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">A = 1:(3*4*7);\r\nA = reshape(A,1,3,4,1,7);\r\nsizeA = size(A)<\/pre><pre style=\"font-style:oblique\">sizeA =\r\n     1     3     4     1     7\r\n<\/pre><p>Show the middle chunk and index into it for one value.<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">A(:,:,10:14)\r\nA(1,2,12)<\/pre><pre style=\"font-style:oblique\">ans(:,:,1) =\r\n    28    29    30\r\nans(:,:,2) =\r\n    31    32    33\r\nans(:,:,3) =\r\n    34    35    36\r\nans(:,:,4) =\r\n    37    38    39\r\nans(:,:,5) =\r\n    40    41    42\r\nans =\r\n    35\r\n<\/pre><div>\r\n      <ul>\r\n         <li><b>Indexing with <tt>:<\/tt><\/b> The colon means to select all elements in that specific dimension. This is equivalent to using <tt>1:end<\/tt> for the dimension of interest.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">A = magic(3)\r\nB = A(:,2)\r\nC = A(1:2,:)<\/pre><pre style=\"font-style:oblique\">A =\r\n     8     1     6\r\n     3     5     7\r\n     4     9     2\r\nB =\r\n     1\r\n     5\r\n     9\r\nC =\r\n     8     1     6\r\n     3     5     7\r\n<\/pre><div>\r\n      <ul>\r\n         <li><b>Indexing with <tt>end<\/tt><\/b> Replace <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/end.html\"><tt>end<\/tt><\/a> with the relevant <tt>size(A,dim)<\/tt> value when using indexing expressions. You can calculate with <tt>end<\/tt>.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">V = 1:3;\r\nV(end-1) = 7<\/pre><pre style=\"font-style:oblique\">V =\r\n     1     7     3\r\n<\/pre><div>\r\n      <ul>\r\n         <li><b>Indexing with a colon-expression<\/b> <tt>n1:n2<\/tt> or <tt>n1:step:n2<\/tt> selects particular entries in the specified dimension and are equivalent to replacing the indices with <tt>[n1 n1+1 ... n2]<\/tt> and <tt>[n1 n1+step n1+2*step ... n1+step*fix((n2-n1)\/step)]<\/tt>.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">A = magic(5)\r\nA(1:3,1:2:5)<\/pre><pre style=\"font-style:oblique\">A =\r\n    17    24     1     8    15\r\n    23     5     7    14    16\r\n     4     6    13    20    22\r\n    10    12    19    21     3\r\n    11    18    25     2     9\r\nans =\r\n    17     1    15\r\n    23     7    16\r\n     4    13    22\r\n<\/pre><div>\r\n      <ul>\r\n         <li><b>Indexing with one array<\/b> <tt>C = A(B)<\/tt> produces output the size of <tt>B<\/tt> unless both <tt>A<\/tt> and <tt>B<\/tt> are vectors.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">A = 1:10\r\nB = [1 3; 2 4]\r\nC = A(B)<\/pre><pre style=\"font-style:oblique\">A =\r\n     1     2     3     4     5     6     7     8     9    10\r\nB =\r\n     1     3\r\n     2     4\r\nC =\r\n     1     3\r\n     2     4\r\n<\/pre><p>When both <tt>A<\/tt> and <tt>B<\/tt> are vectors, the number of elements in <tt>C<\/tt> is the number of elements in <tt>B<\/tt> and with orientation of <tt>A<\/tt>.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">row = 1:4\r\ncolumn = (1:4)'\r\nrow(column)\r\ncolumn(row)<\/pre><pre style=\"font-style:oblique\">row =\r\n     1     2     3     4\r\ncolumn =\r\n     1\r\n     2\r\n     3\r\n     4\r\nans =\r\n     1     2     3     4\r\nans =\r\n     1\r\n     2\r\n     3\r\n     4\r\n<\/pre><div>\r\n      <ul>\r\n         <li><b>Indexing with several arrays<\/b> When <tt>C = A(B1,B2,...,Bk)<\/tt>, the size of <tt>C<\/tt> is <tt>[numel(B1), numel(B2), ..., numel(Bk)]<\/tt>.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">A = magic(6)\r\nind1 = [1 4]\r\nind2 = [1 2; 2 6]\r\nC = A(ind1,ind2)<\/pre><pre style=\"font-style:oblique\">A =\r\n    35     1     6    26    19    24\r\n     3    32     7    21    23    25\r\n    31     9     2    22    27    20\r\n     8    28    33    17    10    15\r\n    30     5    34    12    14    16\r\n     4    36    29    13    18    11\r\nind1 =\r\n     1     4\r\nind2 =\r\n     1     2\r\n     2     6\r\nC =\r\n    35     1     1    24\r\n     8    28    28    15\r\n<\/pre><div>\r\n      <ul>\r\n         <li><b>Logical indexing<\/b> Indexing by a logical matrix <tt>B<\/tt> is equivalent to indexing by the column vector <tt>B(:)<\/tt>.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">A = magic(3)\r\nB = [true false; true true]\r\nC = A(B)\r\nArow = A(:)'\r\nC = Arow(B)<\/pre><pre style=\"font-style:oblique\">A =\r\n     8     1     6\r\n     3     5     7\r\n     4     9     2\r\nB =\r\n     1     0\r\n     1     1\r\nC =\r\n     8\r\n     3\r\n     1\r\nArow =\r\n     8     3     4     1     5     9     6     7     2\r\nC =\r\n     8     3     1\r\n<\/pre><h3>Left-Hand Side<a name=\"14\"><\/a><\/h3>\r\n   <div>\r\n      <ul>\r\n         <li><b>General rule for LHS<\/b> In general, the right-hand side needs to be either a scalar or the same size as the left-hand side (except when the left-hand\r\n            side is <tt>A(:)<\/tt> as mentioned below).  Otherwise, you will see an error.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">A = magic(3)\r\nA(:,2) = 17\r\nA(1,:) = 2:2:6<\/pre><pre style=\"font-style:oblique\">A =\r\n     8     1     6\r\n     3     5     7\r\n     4     9     2\r\nA =\r\n     8    17     6\r\n     3    17     7\r\n     4    17     2\r\nA =\r\n     2     4     6\r\n     3    17     7\r\n     4    17     2\r\n<\/pre><div>\r\n      <ul>\r\n         <li><b>Array growth<\/b> Using indices outside the bounds of the array grows the array, appending the values specified from the right-hand side. \r\n            Where no explict values are given, the left-hand side value is set to 0.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">A = 1:3\r\nA(3,[2 4]) = 17<\/pre><pre style=\"font-style:oblique\">A =\r\n     1     2     3\r\nA =\r\n     1     2     3     0\r\n     0     0     0     0\r\n     0    17     0    17\r\n<\/pre><div>\r\n      <ul>\r\n         <li><b>Datatype conversion<\/b> If the left-hand side already exists, values assigned on the right are converted to the datatype of the left-hand side if\r\n            possible.  Otherwise, the operation results in an error.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">A = single(magic(2))\r\nA(1) = 17\r\nclass(A)<\/pre><pre style=\"font-style:oblique\">A =\r\n     1     3\r\n     4     2\r\nA =\r\n    17     3\r\n     4     2\r\nans =\r\nsingle\r\n<\/pre><div>\r\n      <ul>\r\n         <li><b>Deletion<\/b> If the right-hand side is explicitly <tt>[]<\/tt>, then the elements referred to on the left-hand side are deleted.  This is how people remove datapoints with missing information,\r\n            for example.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">A = magic(3)\r\nA([1 3],:) = []<\/pre><pre style=\"font-style:oblique\">A =\r\n     8     1     6\r\n     3     5     7\r\n     4     9     2\r\nA =\r\n     3     5     7\r\n<\/pre><div>\r\n      <ul>\r\n         <li><b><tt>:<\/tt> retains shape<\/b> <tt>A(:)<\/tt> = expression retains the original shape\/size\/datatype of <tt>A<\/tt>, regardless of the shape of the right-hand side.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">A = 1:9;\r\nA(:) = magic(3)<\/pre><pre style=\"font-style:oblique\">A =\r\n     8     3     4     1     5     9     6     7     2\r\n<\/pre><h3>References<a name=\"20\"><\/a><\/h3>\r\n   <p>Here are some references to documentation and other articles related to indexing.<\/p>\r\n   <div>\r\n      <ul>\r\n         <li><a href=\"https:\/\/www.mathworks.com\/company\/newsletters\/articles\/matrix-indexing-in-matlab.html\">Matrix indexing in MATLAB Digest article<\/a><\/li>\r\n         <li><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/ind2sub.html\"><tt>ind2sub<\/tt><\/a><\/li>\r\n         <li><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/sub2ind.html\"><tt>sub2ind<\/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><a href=\"?p=49#respond\">Let me know<\/a> if it's helpful having all the indexing information in one place.\r\n   <\/p>\r\n   <p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br>\r\n      Published with MATLAB&reg; 7.2<br><\/p>\r\n<\/div>\r\n<!--\r\n##### SOURCE BEGIN #####\r\n%% Essence of Indexing\r\n% Indexing into arrays allows you to address portions of the elements of an\r\n% array and treat this subset as an array itself, whether for calculations\r\n% or input to other functions (essentially a right-hand side) or for\r\n% assignment (left-hand side).\r\n%% Dimensions\r\n% Arrays in MATLAB are N-dimensional, with an infinite number of trailing\r\n% singleton dimensions.  Trailing singleton dimensions past the second are\r\n% not displayed or reported on, e.g., with \r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/size.html |size|>.\r\n% No array has fewer than two dimensions.  Empty arrays are the logical\r\n% extension of general arrays but have at least one size 0 dimension.\r\n% The syntax |[]| denotes the empty array of size |0x0| and is treated as\r\n% an exception occasionally (for backward compatibility); it is also used\r\n% specially during assignment.\r\n%% Right-Hand Side\r\n% * *General indexing on RHS* If |A| is an array with N dimensions of size |[s1 s2 ... sN]|, then a\r\n% subset can be extracted by indexing with arrays of indices whos values\r\n% lie between 1 and |si| for each dimension |i = 1,...,N|.  For dimensions\r\n% starting from the right hand side that are scalar, their dimension is\r\n% dropped from the result (e.g., for |size|) and is implicitly 1 unless the\r\n% dimension is |<=2|.\r\nA = rand(2,3,2,1,1,1)\r\nndA = ndims(A)\r\nsizeA = size(A)\r\nB = A(1,2:3,2)\r\nsizeB = size(B)\r\n%%\r\n% * *Indexing with more indices than dimensions* If |i>N| when indexing, the indices |>N| must be 1, otherwise there\r\n% will be an error.\r\nA(1,2,1,1)\r\n%%\r\n%\r\ntry\r\n    A(1,1,1,3)\r\ncatch\r\n    s = lasterror();\r\n    s.message\r\nend\r\n%%\r\n% * *Indexing with fewer indices than dimensions* If the final dimension |i<N|, the right-hand dimensions collapse into\r\n% the final dimension. E.g., if |A = rand(1,3,4,1,7)| and we type\r\n% |A(1,2,12)|, then we get the element as if |A| were reshaped to\r\n% |A(1,3,28)| and then indexed into.  28 repesents the product of the final\r\n% size of the final dimension addressed and the other \"trailing\" ones.\r\nA = 1:(3*4*7);\r\nA = reshape(A,1,3,4,1,7);\r\nsizeA = size(A)\r\n%%\r\n% Show the middle chunk and index into it for one value.\r\nA(:,:,10:14)\r\nA(1,2,12)\r\n%%\r\n% * *Indexing with |:|* The colon means to select all elements in that specific dimension.\r\n% This is equivalent to using |1:end| for the dimension of interest.\r\nA = magic(3)\r\nB = A(:,2)\r\nC = A(1:2,:)\r\n%%\r\n% * *Indexing with |end|* Replace <https:\/\/www.mathworks.com\/help\/matlab\/ref\/end.html |end|>\r\n% with the relevant |size(A,dim)| value when using indexing expressions.\r\n% You can calculate with |end|.  \r\nV = 1:3;\r\nV(end-1) = 7\r\n%%\r\n% * *Indexing with a colon-expression* |n1:n2| or |n1:step:n2| selects particular entries in the specified\r\n% dimension and are equivalent to replacing the indices with |[n1 n1+1 ... n2]|\r\n% and |[n1 n1+step n1+2*step ... n1+step*fix((n2-n1)\/step)]|.\r\nA = magic(5)\r\nA(1:3,1:2:5)\r\n%% \r\n% * *Indexing with one array* |C = A(B)| produces output the size of |B|\r\n% unless both |A| and |B| are vectors.  \r\nA = 1:10\r\nB = [1 3; 2 4]\r\nC = A(B)\r\n%%\r\n% When both |A| and |B| are vectors,\r\n% the number of elements in |C| is the number of elements in |B| and with\r\n% orientation of |A|.\r\nrow = 1:4\r\ncolumn = (1:4)'\r\nrow(column)\r\ncolumn(row)\r\n%%\r\n% * *Indexing with several arrays* When |C = A(B1,B2,...,Bk)|, the size of\r\n% |C| is |[numel(B1), numel(B2), ..., numel(Bk)]|.\r\nA = magic(6)\r\nind1 = [1 4]\r\nind2 = [1 2; 2 6]\r\nC = A(ind1,ind2)\r\n%%\r\n% * *Logical indexing* Indexing by a logical matrix |B| is equivalent to\r\n% indexing by the column vector |B(:)|.\r\nA = magic(3)\r\nB = [true false; true true]\r\nC = A(B)\r\nArow = A(:)'\r\nC = Arow(B)\r\n%% Left-Hand Side\r\n%%\r\n% * *General rule for LHS* In general, the right-hand side needs to be either a scalar or the same\r\n% size as the left-hand side (except when the left-hand side is |A(:)| as\r\n% mentioned below).  Otherwise, you will see an error.\r\nA = magic(3)\r\nA(:,2) = 17\r\nA(1,:) = 2:2:6\r\n%%\r\n% * *Array growth* Using indices outside the bounds of the array grows the array,\r\n% appending the values specified from the right-hand side.  Where no\r\n% explict values are given, the left-hand side value is set to 0.\r\nA = 1:3\r\nA(3,[2 4]) = 17\r\n%%\r\n% * *Datatype conversion* If the left-hand side already exists, values\r\n% assigned on the right are converted to the datatype of the left-hand side\r\n% if possible.  Otherwise, the operation results in an error.\r\nA = single(magic(2))\r\nA(1) = 17\r\nclass(A)\r\n%%\r\n% * *Deletion* If the right-hand side is explicitly |[]|, then the elements referred\r\n% to on the left-hand side are deleted.  This is how people remove\r\n% datapoints with missing information, for example.\r\nA = magic(3)\r\nA([1 3],:) = []\r\n%%\r\n% * *|:| retains shape* |A(:)| = expression retains the original shape\/size\/datatype of |A|,\r\n% regardless of the shape of the right-hand side.\r\nA = 1:9;\r\nA(:) = magic(3)\r\n%% References\r\n% Here are some references to documentation and other articles related to\r\n% indexing.\r\n%\r\n% * <https:\/\/www.mathworks.com\/company\/newsletters\/articles\/matrix-indexing-in-matlab.html Matrix indexing in MATLAB Digest article>\r\n% * <https:\/\/www.mathworks.com\/access\/helpdesk\/help\/techdoc\/matlab_prog\/f1-85462.html MATLAB documentation on indexing>\r\n% * <https:\/\/www.mathworks.com\/help\/matlab\/ref\/ind2sub.html |ind2sub|>\r\n% * <https:\/\/www.mathworks.com\/help\/matlab\/ref\/sub2ind.html |sub2ind|>\r\n% * <https:\/\/www.mathworks.com\/help\/matlab\/ref\/subsasgn.html |subsasgn|>\r\n%\r\n%\r\n% <?p=49#respond Let me know> if it's helpful having all the indexing information in one\r\n% place.\r\n\r\n##### SOURCE END #####\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   \r\n      Indexing into arrays allows you to address portions of the elements of an array and treat this subset as an array itself,\r\n         whether for calculations or input to other functions... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/loren\/2006\/08\/09\/essence-of-indexing\/\">read more >><\/a><\/p>","protected":false},"author":39,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,12],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/49"}],"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=49"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/49\/revisions"}],"predecessor-version":[{"id":1812,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/49\/revisions\/1812"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/media?parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/categories?post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/tags?post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}