<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, extracting elements of vectors?</title>
    <link>http://www.mapleprimes.com/questions/38807-Extracting-Elements-Of-Vectors</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 21:33:16 GMT</lastBuildDate>
    <pubDate>Wed, 10 Jun 2026 21:33:16 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, extracting elements of vectors?</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, extracting elements of vectors?</title>
      <link>http://www.mapleprimes.com/questions/38807-Extracting-Elements-Of-Vectors</link>
    </image>
    <item>
      <title>function?</title>
      <link>http://www.mapleprimes.com/questions/38807-Extracting-Elements-Of-Vectors?ref=Feed:MaplePrimes:extracting elements of vectors?:Comments#answer70057</link>
      <itunes:summary>&lt;p&gt;Sorry, what do you want to make into a function?&lt;/p&gt;
&lt;p&gt;Are you saying that you want a function which takes in a Matrix and returns the first element of the Vector of its eigenvalues?&lt;/p&gt;
&lt;pre&gt;
e := m -&amp;gt; LinearAlgebra:-Eigenvalues(m)[1];
M := &amp;lt;&amp;lt;2,3&amp;gt;|&amp;lt;4,-1&amp;gt;&amp;gt;;
e(M);
&lt;/pre&gt;
&lt;p&gt;Or are you after something else? Maybe you want a function for that eigenvalue in terms of indeterminates contained in a Matrix input?&lt;/p&gt;
&lt;pre&gt;
e := m -&amp;gt; unapply(LinearAlgebra:-Eigenvalues(m)[1],op(indets(m)));
f := e(&amp;lt;&amp;lt;2,c&amp;gt;|&amp;lt;4,-1&amp;gt;&amp;gt;);
f(3);
&lt;/pre&gt;
&lt;p&gt;Just a little more detail might help, thanks.&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Sorry, what do you want to make into a function?&lt;/p&gt;
&lt;p&gt;Are you saying that you want a function which takes in a Matrix and returns the first element of the Vector of its eigenvalues?&lt;/p&gt;
&lt;pre&gt;
e := m -&amp;gt; LinearAlgebra:-Eigenvalues(m)[1];
M := &amp;lt;&amp;lt;2,3&amp;gt;|&amp;lt;4,-1&amp;gt;&amp;gt;;
e(M);
&lt;/pre&gt;
&lt;p&gt;Or are you after something else? Maybe you want a function for that eigenvalue in terms of indeterminates contained in a Matrix input?&lt;/p&gt;
&lt;pre&gt;
e := m -&amp;gt; unapply(LinearAlgebra:-Eigenvalues(m)[1],op(indets(m)));
f := e(&amp;lt;&amp;lt;2,c&amp;gt;|&amp;lt;4,-1&amp;gt;&amp;gt;);
f(3);
&lt;/pre&gt;
&lt;p&gt;Just a little more detail might help, thanks.&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>70057</guid>
      <pubDate>Fri, 22 Aug 2008 04:54:22 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>Thanks acer,
I have a matrix</title>
      <link>http://www.mapleprimes.com/questions/38807-Extracting-Elements-Of-Vectors?ref=Feed:MaplePrimes:extracting elements of vectors?:Comments#answer70055</link>
      <itunes:summary>&lt;p&gt;Thanks acer,&lt;/p&gt;
&lt;p&gt;I have a matrix K,&lt;/p&gt;
&lt;p&gt;and I got its eigenvalues by: eigs:= Eigenvalues(K);&lt;/p&gt;
&lt;p&gt;Now I have the three eigenvalues in a vector called eigs.&lt;/p&gt;
&lt;p&gt;I want to define Eig1:= &amp;quot;The first element of eigs&amp;quot; , Eig2 := &amp;quot;The second element of eigs&amp;quot; , Eig3:=&amp;quot;the third element of eigs&amp;quot;&lt;/p&gt;
&lt;p&gt;Without copying and pasting the expression originally given by Maple when I used the Eigenvalues(K) command.&lt;/p&gt;
&lt;p&gt;My eigenvalues are gigantic and Maple's taking a LONG time to copy and paste them, and then it doesn't even paste them correctly, so I was hoping there was just a way to extract the n'th element of the vector eigs , just like in Matlab how we can do eigs(1).&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Thanks acer,&lt;/p&gt;
&lt;p&gt;I have a matrix K,&lt;/p&gt;
&lt;p&gt;and I got its eigenvalues by: eigs:= Eigenvalues(K);&lt;/p&gt;
&lt;p&gt;Now I have the three eigenvalues in a vector called eigs.&lt;/p&gt;
&lt;p&gt;I want to define Eig1:= &amp;quot;The first element of eigs&amp;quot; , Eig2 := &amp;quot;The second element of eigs&amp;quot; , Eig3:=&amp;quot;the third element of eigs&amp;quot;&lt;/p&gt;
&lt;p&gt;Without copying and pasting the expression originally given by Maple when I used the Eigenvalues(K) command.&lt;/p&gt;
&lt;p&gt;My eigenvalues are gigantic and Maple's taking a LONG time to copy and paste them, and then it doesn't even paste them correctly, so I was hoping there was just a way to extract the n'th element of the vector eigs , just like in Matlab how we can do eigs(1).&lt;/p&gt;</description>
      <guid>70055</guid>
      <pubDate>Fri, 22 Aug 2008 05:19:56 Z</pubDate>
      <itunes:author>ndattani</itunes:author>
      <author>ndattani</author>
    </item>
    <item>
      <title>Thanks a lot acer!
 
That</title>
      <link>http://www.mapleprimes.com/questions/38807-Extracting-Elements-Of-Vectors?ref=Feed:MaplePrimes:extracting elements of vectors?:Comments#answer70047</link>
      <itunes:summary>&lt;p&gt;Thanks a lot acer!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That was very helpful.&amp;nbsp; I was not able to extract the elements of the eigenvalue vector&amp;nbsp; using&lt;/p&gt;
&lt;pre&gt;
a := evals[1]:

after getting the eingenvalues by
evals := LinearAlgebra:-Eigenvalues(M):


I tried on both Maple 10 and 11.  But I did the second thing you told me to do (right-clicking and using the context-menues, and then I was surely able to apply the commands
evals:=%; and a:=evals[1];

I'm not sure why a:=evals[1] didn't work when I got the eingenvalues the first way.
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Thanks a lot acer!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That was very helpful.&amp;nbsp; I was not able to extract the elements of the eigenvalue vector&amp;nbsp; using&lt;/p&gt;
&lt;pre&gt;
a := evals[1]:

after getting the eingenvalues by
evals := LinearAlgebra:-Eigenvalues(M):


I tried on both Maple 10 and 11.  But I did the second thing you told me to do (right-clicking and using the context-menues, and then I was surely able to apply the commands
evals:=%; and a:=evals[1];

I'm not sure why a:=evals[1] didn't work when I got the eingenvalues the first way.
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>70047</guid>
      <pubDate>Fri, 22 Aug 2008 16:28:38 Z</pubDate>
      <itunes:author>ndattani</itunes:author>
      <author>ndattani</author>
    </item>
    <item>
      <title>ok</title>
      <link>http://www.mapleprimes.com/questions/38807-Extracting-Elements-Of-Vectors?ref=Feed:MaplePrimes:extracting elements of vectors?:Comments#comment82956</link>
      <itunes:summary>&lt;p&gt;You can end the line with a colon (not the usual semicolon) and it will suppress printing all those pages of output.&lt;/p&gt;
&lt;pre&gt;
evals := LinearAlgebra:-Eigenvalues(M):
&lt;/pre&gt;
&lt;p&gt;If your resulting Vector has been assigned to a variable (above, evals) then you can access its elements as evals[1], evals[2], etc. Or, you can assign those to new variables.&lt;/p&gt;
&lt;pre&gt;
a := evals[1]:
&lt;/pre&gt;
&lt;p&gt;If you got the Vector of eigenvalues by using the context-menus (ie. by right-clicking on a Matrix and using the popup menus) then you can immediately refer to that Vector by using the % symbol. In Maple, % means the &amp;quot;last thing evaluated&amp;quot;. See the help-page on topic &lt;b&gt;ditto&lt;/b&gt;. For example, you could do as follows.&lt;/p&gt;
&lt;pre&gt;
evals := %:
evals[1];
&lt;/pre&gt;
&lt;p&gt;Your question is not a bad one. It's quite normal to want to simply enter a command like Eigenvalues(M) without assigning it to anything. And then, when it's finished, you want to assign it to some variable without having to wait while recomputing the whole thing. The %, %%, and %%% constructs let you do just that.&lt;/p&gt;
&lt;p&gt;The help-page is named &amp;quot;ditto&amp;quot;, because many releases ago the symbols for this were double-quotes (&amp;quot;) rather than percent (%).&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;You can end the line with a colon (not the usual semicolon) and it will suppress printing all those pages of output.&lt;/p&gt;
&lt;pre&gt;
evals := LinearAlgebra:-Eigenvalues(M):
&lt;/pre&gt;
&lt;p&gt;If your resulting Vector has been assigned to a variable (above, evals) then you can access its elements as evals[1], evals[2], etc. Or, you can assign those to new variables.&lt;/p&gt;
&lt;pre&gt;
a := evals[1]:
&lt;/pre&gt;
&lt;p&gt;If you got the Vector of eigenvalues by using the context-menus (ie. by right-clicking on a Matrix and using the popup menus) then you can immediately refer to that Vector by using the % symbol. In Maple, % means the &amp;quot;last thing evaluated&amp;quot;. See the help-page on topic &lt;b&gt;ditto&lt;/b&gt;. For example, you could do as follows.&lt;/p&gt;
&lt;pre&gt;
evals := %:
evals[1];
&lt;/pre&gt;
&lt;p&gt;Your question is not a bad one. It's quite normal to want to simply enter a command like Eigenvalues(M) without assigning it to anything. And then, when it's finished, you want to assign it to some variable without having to wait while recomputing the whole thing. The %, %%, and %%% constructs let you do just that.&lt;/p&gt;
&lt;p&gt;The help-page is named &amp;quot;ditto&amp;quot;, because many releases ago the symbols for this were double-quotes (&amp;quot;) rather than percent (%).&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>82956</guid>
      <pubDate>Fri, 22 Aug 2008 06:29:21 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
  </channel>
</rss>