Path: news.mathworks.com!not-for-mail
From: "Muhammad Ramzan" <m.ramzan476@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: need help
Date: Mon, 28 Jan 2013 03:38:08 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 48
Message-ID: <ke4rr0$mkb$1@newscl01ah.mathworks.com>
References: <ke3lgn$e7q$1@newscl01ah.mathworks.com> <ke3u4k$ddo$1@speranza.aioe.org>
Reply-To: "Muhammad Ramzan" <m.ramzan476@yahoo.com>
NNTP-Posting-Host: www-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1359344288 23179 172.30.248.48 (28 Jan 2013 03:38:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 28 Jan 2013 03:38:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 4017512
Xref: news.mathworks.com comp.soft-sys.matlab:787520

Your reply reads;

> syms p
> A = [1 p;0 1];
> B = [1 p;0 1-p];
> 
> mat = npermutek(['A' 'B'],4);
> 
> for i=1:length(mat)
>      a=eval(sym(mat(i,1)));
>      b=eval(sym(mat(i,2)));
>      c=eval(sym(mat(i,3)));
>      d=eval(sym(mat(i,3)));
>      kron(kron(kron(a,b),c),d)
> end
> ------------------------------------
> 
> answer for first row AAAA is
> 
>   
> [ 1, p, p, p^2, p, p^2, p^2, p^3, p, p^2, p^2, p^3, p^2, p^3, p^3, p^4]
> [ 0, 1, 0,   p, 0,   p,   0, p^2, 0,   p,   0, p^2,   0, p^2,   0, p^3]
> [ 0, 0, 1,   p, 0,   0,   p, p^2, 0,   0,   p, p^2,   0,   0, p^2, p^3]
> [ 0, 0, 0,   1, 0,   0,   0,   p, 0,   0,   0,   p,   0,   0,   0, p^2]
> [ 0, 0, 0,   0, 1,   p,   p, p^2, 0,   0,   0,   0,   p, p^2, p^2, p^3]
> [ 0, 0, 0,   0, 0,   1,   0,   p, 0,   0,   0,   0,   0,   p,   0, p^2]
> [ 0, 0, 0,   0, 0,   0,   1,   p, 0,   0,   0,   0,   0,   0,   p, p^2]
> [ 0, 0, 0,   0, 0,   0,   0,   1, 0,   0,   0,   0,   0,   0,   0,   p]
> [ 0, 0, 0,   0, 0,   0,   0,   0, 1,   p,   p, p^2,   p, p^2, p^2, p^3]
> [ 0, 0, 0,   0, 0,   0,   0,   0, 0,   1,   0,   p,   0,   p,   0, p^2]
> [ 0, 0, 0,   0, 0,   0,   0,   0, 0,   0,   1,   p,   0,   0,   p, p^2]
> [ 0, 0, 0,   0, 0,   0,   0,   0, 0,   0,   0,   1,   0,   0,   0,   p]
> [ 0, 0, 0,   0, 0,   0,   0,   0, 0,   0,   0,   0,   1,   p,   p, p^2]
> [ 0, 0, 0,   0, 0,   0,   0,   0, 0,   0,   0,   0,   0,   1,   0,   p]
> [ 0, 0, 0,   0, 0,   0,   0,   0, 0,   0,   0,   0,   0,   0,   1,   p]
> [ 0, 0, 0,   0, 0,   0,   0,   0, 0,   0,   0,   0,   0,   0,   0,   1]
>   
> --Nasser



Kindly clarify

 d=eval(sym(mat(i,3)));
should be  d=eval(sym(mat(i,4))); or not?

Regards,
Ramzan.