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$>
References: <holo0f$do4$> <>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1269734046 27765 (27 Mar 2010 23:54:06 GMT)
NNTP-Posting-Date: Sat, 27 Mar 2010 23:54:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:621093

Don Robison <> wrote in message <>...
> 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