<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Loop variable problems cat - Error, invalid parameters for inline function</title>
    <link>http://www.mapleprimes.com/questions/89706-Loop-Variable-Problems-Cat--Error</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Fri, 12 Jun 2026 14:50:14 GMT</lastBuildDate>
    <pubDate>Fri, 12 Jun 2026 14:50:14 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Loop variable problems cat - Error, invalid parameters for inline function</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Loop variable problems cat - Error, invalid parameters for inline function</title>
      <link>http://www.mapleprimes.com/questions/89706-Loop-Variable-Problems-Cat--Error</link>
    </image>
    <item>
      <title>wrong structure</title>
      <link>http://www.mapleprimes.com/questions/89706-Loop-Variable-Problems-Cat--Error?ref=Feed:MaplePrimes:Loop variable problems cat - Error, invalid parameters for inline function:Comments#answer89714</link>
      <itunes:summary>&lt;p&gt;I suspect that you are likely using structures not best suited for your overall tasks, ie. lists instead of mutable Matrix &amp;amp; Vector.&lt;/p&gt;
&lt;pre&gt;a1:=Matrix([[1,2,3,4,5,6,7],[9,8,7,6,5,4,3],[4,5,4,5,4,5,4]]);&lt;br&gt;&lt;br&gt;# one way&lt;br&gt;b1:=LinearAlgebra:-ColumnOperation(a1,[4,6]);&lt;br&gt;&lt;br&gt;# alternatively&lt;br&gt;b1:=copy(a1):&lt;br&gt;b1[1..-1,4],b1[1..-1,6] := b1[1..-1,6],b1[1..-1,4]:&lt;br&gt;b1;&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;Why use lists of lists?  And why use || to form the names (in other posts as well) instead of just a[i] and b[i]?&lt;/p&gt;
&lt;p&gt;Anyway, if you really must...&lt;/p&gt;
&lt;pre&gt;a1:=[[1,2,3,4,5,6,7],[9,8,7,6,5,4,3],[4,5,4,5,4,5,4]];
G:=(L,x,y)-&amp;gt;[op(L[1..x-1]),L[y],op(L[x+1..y-1]),L[x],op(L[y+1..-1])]:
map(G,a1,4,6);
&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;I suspect that you are likely using structures not best suited for your overall tasks, ie. lists instead of mutable Matrix &amp;amp; Vector.&lt;/p&gt;
&lt;pre&gt;a1:=Matrix([[1,2,3,4,5,6,7],[9,8,7,6,5,4,3],[4,5,4,5,4,5,4]]);&lt;br&gt;&lt;br&gt;# one way&lt;br&gt;b1:=LinearAlgebra:-ColumnOperation(a1,[4,6]);&lt;br&gt;&lt;br&gt;# alternatively&lt;br&gt;b1:=copy(a1):&lt;br&gt;b1[1..-1,4],b1[1..-1,6] := b1[1..-1,6],b1[1..-1,4]:&lt;br&gt;b1;&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;Why use lists of lists?  And why use || to form the names (in other posts as well) instead of just a[i] and b[i]?&lt;/p&gt;
&lt;p&gt;Anyway, if you really must...&lt;/p&gt;
&lt;pre&gt;a1:=[[1,2,3,4,5,6,7],[9,8,7,6,5,4,3],[4,5,4,5,4,5,4]];
G:=(L,x,y)-&amp;gt;[op(L[1..x-1]),L[y],op(L[x+1..y-1]),L[x],op(L[y+1..-1])]:
map(G,a1,4,6);
&lt;/pre&gt;</description>
      <guid>89714</guid>
      <pubDate>Tue, 15 Jun 2010 18:37:13 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
    <item>
      <title>possible solution</title>
      <link>http://www.mapleprimes.com/questions/89706-Loop-Variable-Problems-Cat--Error?ref=Feed:MaplePrimes:Loop variable problems cat - Error, invalid parameters for inline function:Comments#answer89729</link>
      <itunes:summary>&lt;p&gt;I believe that the suggestion that pagan suggested is likely the most efficient, but if you just want to use your list of lists and use map then the following should work.&lt;/p&gt;
&lt;p&gt;for i to 3 do &lt;br&gt;&amp;nbsp; b || i := map((x) -&amp;gt; [x[4], x[6]], a || i) &lt;br&gt;end do;&lt;/p&gt;
&lt;p&gt;This should allow you to go through each of the 'a' lists and take the 4th and 6th position.&lt;/p&gt;
&lt;p&gt;If you wanted to have the 'a' values as Matrices you could simplify this as the following&lt;/p&gt;
&lt;p&gt;a1 := Matrix([[1, 2, 3, 4, 5, 6, 7], [9, 8, 7, 6, 5, 4, 3], [4, 5, 4, 5, 4, 5, 4]]):&lt;br&gt;a2 := Matrix([[2, 3, 4, 5, 6, 7, 8], [8, 7, 6, 5, 4, 3, 2], [3, 4, 3, 4, 3, 4, 3]]): &lt;br&gt;a3 := Matrix([[3, 4, 5, 6, 7, 8, 9], [7, 6, 5, 4, 3, 2, 1], [2, 3, 2, 3, 2, 3, 2]]):&lt;/p&gt;
&lt;p&gt;seq(assign(b || i, a || i( .. , [4, 6])), i = 1 .. 3):&lt;/p&gt;
&lt;p&gt;I hope this helps.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;I believe that the suggestion that pagan suggested is likely the most efficient, but if you just want to use your list of lists and use map then the following should work.&lt;/p&gt;
&lt;p&gt;for i to 3 do &lt;br&gt;&amp;nbsp; b || i := map((x) -&amp;gt; [x[4], x[6]], a || i) &lt;br&gt;end do;&lt;/p&gt;
&lt;p&gt;This should allow you to go through each of the 'a' lists and take the 4th and 6th position.&lt;/p&gt;
&lt;p&gt;If you wanted to have the 'a' values as Matrices you could simplify this as the following&lt;/p&gt;
&lt;p&gt;a1 := Matrix([[1, 2, 3, 4, 5, 6, 7], [9, 8, 7, 6, 5, 4, 3], [4, 5, 4, 5, 4, 5, 4]]):&lt;br&gt;a2 := Matrix([[2, 3, 4, 5, 6, 7, 8], [8, 7, 6, 5, 4, 3, 2], [3, 4, 3, 4, 3, 4, 3]]): &lt;br&gt;a3 := Matrix([[3, 4, 5, 6, 7, 8, 9], [7, 6, 5, 4, 3, 2, 1], [2, 3, 2, 3, 2, 3, 2]]):&lt;/p&gt;
&lt;p&gt;seq(assign(b || i, a || i( .. , [4, 6])), i = 1 .. 3):&lt;/p&gt;
&lt;p&gt;I hope this helps.&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;</description>
      <guid>89729</guid>
      <pubDate>Tue, 15 Jun 2010 23:47:19 Z</pubDate>
      <itunes:author>Scott03</itunes:author>
      <author>Scott03</author>
    </item>
    <item>
      <title>with index</title>
      <link>http://www.mapleprimes.com/questions/89706-Loop-Variable-Problems-Cat--Error?ref=Feed:MaplePrimes:Loop variable problems cat - Error, invalid parameters for inline function:Comments#answer89730</link>
      <itunes:summary>&lt;p&gt;I don't see why it wouldn't work for you with a[i] and b[i] as indexed names.&lt;/p&gt;
&lt;pre&gt;a[1]:=[[1,2,3,4,5,6,7],[9,8,7,6,5,4,3],[4,5,4,5,4,5,4]]:
a[2]:=[[2,3,4,5,6,7,8],[8,7,6,5,4,3,2],[3,4,3,4,3,4,3]]:
a[3]:=[[3,4,5,6,7,8,9],[7,6,5,4,3,2,1],[2,3,2,3,2,3,2]]:

G:=(L,x,y)-&amp;gt;[op(L[1..x-1]),L[y],op(L[x+1..y-1]),L[x],op(L[y+1..-1])]:

for i from 1 to 3 do
  b[i]:=map(G,a[i],4,6);
end do;
&lt;/pre&gt;
&lt;p&gt;ps. Scott, he wanted to create new objects, where b[i] is a[i] with swapped 4th and 6th entries. He didn't just want to extract just those two entries (which would be simpler to do, 'natch.)&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;I don't see why it wouldn't work for you with a[i] and b[i] as indexed names.&lt;/p&gt;
&lt;pre&gt;a[1]:=[[1,2,3,4,5,6,7],[9,8,7,6,5,4,3],[4,5,4,5,4,5,4]]:
a[2]:=[[2,3,4,5,6,7,8],[8,7,6,5,4,3,2],[3,4,3,4,3,4,3]]:
a[3]:=[[3,4,5,6,7,8,9],[7,6,5,4,3,2,1],[2,3,2,3,2,3,2]]:

G:=(L,x,y)-&amp;gt;[op(L[1..x-1]),L[y],op(L[x+1..y-1]),L[x],op(L[y+1..-1])]:

for i from 1 to 3 do
  b[i]:=map(G,a[i],4,6);
end do;
&lt;/pre&gt;
&lt;p&gt;ps. Scott, he wanted to create new objects, where b[i] is a[i] with swapped 4th and 6th entries. He didn't just want to extract just those two entries (which would be simpler to do, 'natch.)&lt;/p&gt;</description>
      <guid>89730</guid>
      <pubDate>Tue, 15 Jun 2010 23:58:10 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
    <item>
      <title>structure</title>
      <link>http://www.mapleprimes.com/questions/89706-Loop-Variable-Problems-Cat--Error?ref=Feed:MaplePrimes:Loop variable problems cat - Error, invalid parameters for inline function:Comments#comment89717</link>
      <itunes:summary>&lt;p&gt;For some reason I was thinking b[i] might wipe out the position of b[i].&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Okay, so if I change my name structure so it's&lt;/p&gt;
&lt;p&gt;a[1]:= [[ ...&lt;/p&gt;
&lt;p&gt;a[2]:=[[ ...&lt;/p&gt;
&lt;p&gt;a[3]:=[[ ...&lt;/p&gt;
&lt;p&gt;and use b[i] it still doesn't work like I thought it would.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It appears map doesn't like variable b[i][4] and b[i][6]&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;For some reason I was thinking b[i] might wipe out the position of b[i].&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Okay, so if I change my name structure so it's&lt;/p&gt;
&lt;p&gt;a[1]:= [[ ...&lt;/p&gt;
&lt;p&gt;a[2]:=[[ ...&lt;/p&gt;
&lt;p&gt;a[3]:=[[ ...&lt;/p&gt;
&lt;p&gt;and use b[i] it still doesn't work like I thought it would.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It appears map doesn't like variable b[i][4] and b[i][6]&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>89717</guid>
      <pubDate>Tue, 15 Jun 2010 20:26:51 Z</pubDate>
      <itunes:author>Christopher2222</itunes:author>
      <author>Christopher2222</author>
    </item>
    <item>
      <title>objects</title>
      <link>http://www.mapleprimes.com/questions/89706-Loop-Variable-Problems-Cat--Error?ref=Feed:MaplePrimes:Loop variable problems cat - Error, invalid parameters for inline function:Comments#comment89731</link>
      <itunes:summary>&lt;p&gt;I like to add new objects, heh heh.&amp;nbsp; No, I just wanted to know why I couldn't get map to work with indicies in my loop.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the inputs.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;I like to add new objects, heh heh.&amp;nbsp; No, I just wanted to know why I couldn't get map to work with indicies in my loop.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the inputs.&lt;/p&gt;</description>
      <guid>89731</guid>
      <pubDate>Wed, 16 Jun 2010 00:14:52 Z</pubDate>
      <itunes:author>Christopher2222</itunes:author>
      <author>Christopher2222</author>
    </item>
  </channel>
</rss>