<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic label numerical matrix' values in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/label-numerical-matrix-values/m-p/507976#M4397</link>
    <description>&lt;P&gt;I am sure that I can avoid the Do loop in this code. It works but I want to "translate" the numerical matrix to a categorical one.&lt;/P&gt;
&lt;P&gt;Is there a way to map the numerical matrix RES_T&amp;nbsp; to its char sibling RES_T_CH by using the DESC matrix?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IML;

X=1 : 8;
Y=1:10;

RES=T(Y)*X;

LABLX=CHAR(X);
LABLY=CHAR(Y);

R=PALETTE("BLUES",4);

RES2=(MOD(RES,2)=0);
RES4=(MOD(RES,4)=0);
RES8=(MOD(RES,8)=0);

RES_T=RES2+RES4+RES8;

DESC={"no divideix ni per 2, ni 4, ni 8" "divideix per 2" "divideix per 4" "divideix per 8"};
/*print desc;*/

RES_T_CH=J(10,8, "                               ");


DO I=1 TO NROW(RES)*NCOL(RES);
RES_T_CH[I]=DESC[RES_T[I]+1];
END;

CALL HEATMAPDISC(RES_T_ch, R) TITLE="tasca multiplicar per 2,4 i 8" DISPLAYOUTLINES=1 SHOWLEGEND=1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 27 Oct 2018 11:23:47 GMT</pubDate>
    <dc:creator>acordes</dc:creator>
    <dc:date>2018-10-27T11:23:47Z</dc:date>
    <item>
      <title>label numerical matrix' values</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/label-numerical-matrix-values/m-p/507976#M4397</link>
      <description>&lt;P&gt;I am sure that I can avoid the Do loop in this code. It works but I want to "translate" the numerical matrix to a categorical one.&lt;/P&gt;
&lt;P&gt;Is there a way to map the numerical matrix RES_T&amp;nbsp; to its char sibling RES_T_CH by using the DESC matrix?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IML;

X=1 : 8;
Y=1:10;

RES=T(Y)*X;

LABLX=CHAR(X);
LABLY=CHAR(Y);

R=PALETTE("BLUES",4);

RES2=(MOD(RES,2)=0);
RES4=(MOD(RES,4)=0);
RES8=(MOD(RES,8)=0);

RES_T=RES2+RES4+RES8;

DESC={"no divideix ni per 2, ni 4, ni 8" "divideix per 2" "divideix per 4" "divideix per 8"};
/*print desc;*/

RES_T_CH=J(10,8, "                               ");


DO I=1 TO NROW(RES)*NCOL(RES);
RES_T_CH[I]=DESC[RES_T[I]+1];
END;

CALL HEATMAPDISC(RES_T_ch, R) TITLE="tasca multiplicar per 2,4 i 8" DISPLAYOUTLINES=1 SHOWLEGEND=1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 27 Oct 2018 11:23:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/label-numerical-matrix-values/m-p/507976#M4397</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2018-10-27T11:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: label numerical matrix' values</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/label-numerical-matrix-values/m-p/507977#M4398</link>
      <description>&lt;P&gt;Yes. No need loop, just directly refer to&amp;nbsp;RES_T as an index matrix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html;


PROC IML;

X=1 : 8;
Y=1:10;

RES=T(Y)*X;

LABLX=CHAR(X);
LABLY=CHAR(Y);

*R=PALETTE("BLUES",4);

RES2=(MOD(RES,2)=0);
RES4=(MOD(RES,4)=0);
RES8=(MOD(RES,8)=0);

RES_T=RES2+RES4+RES8;

DESC={"no divideix ni per 2, ni 4, ni 8" "divideix per 2" "divideix per 4" "divideix per 8"};
/*print desc;*/


RES_T_CH=SHAPE(DESC[RES_T+1],NROW(RES_T));

print res_t,res_t_ch;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 27 Oct 2018 11:40:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/label-numerical-matrix-values/m-p/507977#M4398</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-10-27T11:40:37Z</dc:date>
    </item>
  </channel>
</rss>

