Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: need help
Posted:
Jan 28, 2013 7:47 AM


On 1/27/2013 9:56 PM, Muhammad Ramzan wrote: > Your reply reads; > >> syms p >> A = [1 p;0 1]; >> B = [1 p;0 1p]; >> >> 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 >>  >>
> > > Kindly clarify and help further > > 1. d=eval(sym(mat(i,3))); whether it should be d=eval(sym(mat(i,4))); or not?
yes ofocurse. It was just a typo. It is clear it should have been mat(i,4).
> > 2. I have to further use these 16 matrices, generated by the code >you have supplied through kron(kron(kron(a,b),c),d), for multiplication with >another 16x16 matrix, say the first one you have given in your reply and to sum up the result. > please help also for it. > i.e. tensor(A,A,A,A).(16x16 matrix).ctranspose(tensor(A,A,A,A))+.......+ >tensor(B,B,B,B).(16x16 matrix).ctranspose(tensor(B,B,B,B)) > > where tensor(A,A,A,A) means the first 16x16 matrix generated by your code and given by you above. >
I do not have time now. But why do not you try to work it out. I suggest doing one step at a time. You are working in symbolics, so you need to stick to Matlab functions that supports symbolics.
Take the result from one row, and do the operations above on it. Add the code in the loop shown above.
Sorry, I have a HW to finish myself and no time.
good luck Nasser



