Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: need help
Replies: 3   Last Post: Jan 28, 2013 7:47 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Nasser Abbasi

Posts: 5,647
Registered: 2/7/05
Re: need help
Posted: Jan 28, 2013 7:47 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 1/27/2013 9:56 PM, Muhammad Ramzan wrote:
> 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
>> ------------------------------------
>>



>
>
> 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




Date Subject Author
1/27/13
Read Re: need help
Nasser Abbasi
1/28/13
Read Re: need help
Nasser Abbasi

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.