It may be a very simple question For a symmetric matrix A (3×3), say A=[2 4 6;4 8 11;6 11 20], the way to extract its unique elements (on and lower the diagonal) in an output vector B is:
B=(A(tril(A)~=0))B = 2 4 6 8 11 20
How can I create matrices C1,C2,C3,…,C6, such that
B(1)=A.*C1, B(2)=A.*C2, ..., B(6)=A.*C6C1=[1 0 0;0 0 0;0 0 0];C2=[0 0 0;1 0 0;0 0 0];C3=[0 0 0;0 0 0;1 0 0];C4=[0 0 0;0 1 0;0 0 0];C5=[0 0 0;0 0 0;0 1 0];C6=[0 0 0;0 0 0;0 0 1];
Best Answer