Path: news.mathworks.com!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: Re: if d = x^2, and x=[0,0;1,0] then why is eval(d) not equal to Date: Sat, 27 Mar 2010 23:54:06 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 10 Message-ID: <hom5qu$r3l$1@fred.mathworks.com> References: <holo0f$do4$1@fred.mathworks.com> <1396842502.455793.1269723085870.JavaMail.root@gallium.mathforum.org> Reply-To: <HIDDEN> NNTP-Posting-Host: webapp-03-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1269734046 27765 172.30.248.38 (27 Mar 2010 23:54:06 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Sat, 27 Mar 2010 23:54:06 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 1187260 Xref: news.mathworks.com comp.soft-sys.matlab:621093 Don Robison <joe_blow_281@hotmail.com> wrote in message <1396842502.455793.1269723085870.JavaMail.root@gallium.mathforum.org>... > Hello us. This is Don Robison. Thank you for your help, but the code does not return x^2. I need to evaluate a symbolic expression such as x^i*y^i*z^k, and have the matrix multiplied by itself i,j,k times. The code you gave seems to just return xd without taking it to the second power. > > the input must be a trinomial with any power, the output must be that a sum of matrices that have been multiplied by themselves as many times as the exponent in the term. > > the output I am looking for in this particular instance would be [0,0;0,0] or xd^2. Actually [0,0;0,0] is the correct answer! The matrix product of that matrix by itself is all zeros. Roger Stafford