<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Scaling the rows of a Matrix in a particular way</title>
    <link>http://www.mapleprimes.com/questions/136139-Scaling-The-Rows-Of-A-Matrix-In-A-Particular-Way</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Wed, 10 Jun 2026 18:59:23 GMT</lastBuildDate>
    <pubDate>Wed, 10 Jun 2026 18:59:23 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Scaling the rows of a Matrix in a particular way</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Scaling the rows of a Matrix in a particular way</title>
      <link>http://www.mapleprimes.com/questions/136139-Scaling-The-Rows-Of-A-Matrix-In-A-Particular-Way</link>
    </image>
    <item>
      <title>Procedure</title>
      <link>http://www.mapleprimes.com/questions/136139-Scaling-The-Rows-Of-A-Matrix-In-A-Particular-Way?ref=Feed:MaplePrimes:Scaling the rows of a Matrix in a particular way:Comments#answer136146</link>
      <itunes:summary>&lt;p&gt;If I understand your problem, it is simple. Should be in the loop to multiply all the elements of each row to the least common multiple of their denominators.&lt;/p&gt;
&lt;p&gt;Code of the procedure:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;DoIntegers:=proc(A)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;local m, n, i, j, d, B, f;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;uses LinearAlgebra;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;m:=RowDimension(A);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;n:=ColumnDimension(A);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;for i to m do&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;d:=ilcm(seq(denom(A[i,j]), j=1..n));&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;for j to n do&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;B[i,j]:=A[i,j]*d;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;od; od;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;f:=(i,j)-&amp;gt;B[i,j];&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;B:=Matrix(m, n, f);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;end proc:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A:=Matrix([[1, 1/2, 1/3], [1/4, 1/5, 1/6], [7, 8, 9]]);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;B=DoIntegers(A);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img src="http://s59.radikal.ru/i163/1208/76/6ac4b496e462.png" alt="" width="264" height="238"&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;If I understand your problem, it is simple. Should be in the loop to multiply all the elements of each row to the least common multiple of their denominators.&lt;/p&gt;
&lt;p&gt;Code of the procedure:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;DoIntegers:=proc(A)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;local m, n, i, j, d, B, f;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;uses LinearAlgebra;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;m:=RowDimension(A);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;n:=ColumnDimension(A);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;for i to m do&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;d:=ilcm(seq(denom(A[i,j]), j=1..n));&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;for j to n do&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;B[i,j]:=A[i,j]*d;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;od; od;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;f:=(i,j)-&amp;gt;B[i,j];&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;B:=Matrix(m, n, f);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;end proc:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A:=Matrix([[1, 1/2, 1/3], [1/4, 1/5, 1/6], [7, 8, 9]]);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;B=DoIntegers(A);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img src="http://s59.radikal.ru/i163/1208/76/6ac4b496e462.png" alt="" width="264" height="238"&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>136146</guid>
      <pubDate>Wed, 01 Aug 2012 21:15:18 Z</pubDate>
      <itunes:author>Kitonum</itunes:author>
      <author>Kitonum</author>
    </item>
  </channel>
</rss>