<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Error,  bad index into Matrix</title>
    <link>http://www.mapleprimes.com/questions/129326-Error--Bad-Index-Into-Matrix</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Sat, 13 Jun 2026 02:10:27 GMT</lastBuildDate>
    <pubDate>Sat, 13 Jun 2026 02:10:27 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Error,  bad index into Matrix</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Error,  bad index into Matrix</title>
      <link>http://www.mapleprimes.com/questions/129326-Error--Bad-Index-Into-Matrix</link>
    </image>
    <item>
      <title>bad index into Matrix</title>
      <link>http://www.mapleprimes.com/questions/129326-Error--Bad-Index-Into-Matrix?ref=Feed:MaplePrimes:Error,  bad index into Matrix:Comments#answer129338</link>
      <itunes:summary>&lt;p&gt;That error message often means that the code has referenced a Matrix with indices which are names which do not evaluate to integer values. For example&lt;/p&gt;
&lt;pre&gt;restart:

u:=Matrix([[3]]):

u[i,i];
Error, bad index into Matrix
&lt;/pre&gt;
&lt;p&gt;The problem is that `i` was not an integer value (within the valid bounds range of just 1 to 1).&lt;/p&gt;
&lt;p&gt;This can happen in a few ways. You might have a line of code where you intended `i` to have a value, but it actually didn't.&lt;/p&gt;
&lt;p&gt;One common scenario is that the code calls `sum` and the first argument to the `sum` call is a formula containing things like u[i,j] say. Since `sum` does not have &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=spec_eval_rules"&gt;special evaluation rules&lt;/a&gt; Maple will try and evaluate u[i,j] before `i` and/or `j` the indices of summation get assigned any numeric values. And then bang. If that is your situation then try replacing calls to `sum`, for summing finitely many terms, by calls to `add` instead.&lt;/p&gt;
&lt;p&gt;Now here is the best bit: in the Maple Standard GUI that error message is a hyperlink. If you follow its URL in a web browser then you will get to an &lt;a href="http://www.maplesoft.com/support/help/errors/view.aspx?path=Error,%20bad%20index%20into%20Matrix"&gt;Online help page&lt;/a&gt; which gives pretty much the same explanation.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;That error message often means that the code has referenced a Matrix with indices which are names which do not evaluate to integer values. For example&lt;/p&gt;
&lt;pre&gt;restart:

u:=Matrix([[3]]):

u[i,i];
Error, bad index into Matrix
&lt;/pre&gt;
&lt;p&gt;The problem is that `i` was not an integer value (within the valid bounds range of just 1 to 1).&lt;/p&gt;
&lt;p&gt;This can happen in a few ways. You might have a line of code where you intended `i` to have a value, but it actually didn't.&lt;/p&gt;
&lt;p&gt;One common scenario is that the code calls `sum` and the first argument to the `sum` call is a formula containing things like u[i,j] say. Since `sum` does not have &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=spec_eval_rules"&gt;special evaluation rules&lt;/a&gt; Maple will try and evaluate u[i,j] before `i` and/or `j` the indices of summation get assigned any numeric values. And then bang. If that is your situation then try replacing calls to `sum`, for summing finitely many terms, by calls to `add` instead.&lt;/p&gt;
&lt;p&gt;Now here is the best bit: in the Maple Standard GUI that error message is a hyperlink. If you follow its URL in a web browser then you will get to an &lt;a href="http://www.maplesoft.com/support/help/errors/view.aspx?path=Error,%20bad%20index%20into%20Matrix"&gt;Online help page&lt;/a&gt; which gives pretty much the same explanation.&lt;/p&gt;</description>
      <guid>129338</guid>
      <pubDate>Thu, 05 Jan 2012 06:51:33 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
    <item>
      <title>thanks</title>
      <link>http://www.mapleprimes.com/questions/129326-Error--Bad-Index-Into-Matrix?ref=Feed:MaplePrimes:Error,  bad index into Matrix:Comments#comment129380</link>
      <itunes:summary>&lt;p&gt;thank u so much , by using add for sum my problem was removed.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;thank u so much , by using add for sum my problem was removed.&lt;/p&gt;</description>
      <guid>129380</guid>
      <pubDate>Fri, 06 Jan 2012 14:54:12 Z</pubDate>
      <itunes:author>hopereza86</itunes:author>
      <author>hopereza86</author>
    </item>
  </channel>
</rss>