MATLAB: How to make a hermitian symbolic matrix in matlan

symbolic matrix

hello I need to make a hermitian symmetric matrix with size L*L (2<L<20)
for example if L=2
A=[a c+1i*d; c-1i*d b] where a,b ,c and d are real symbol it seems too hard for large L… can any one help me? best regards maryam.

Best Answer

hi every one I found how to make symbolic hermitian matrix myself. the code is written below . D is a hermitian Symbolic matrix with size(L*L).
A = sym('A%d%d', L); A = sym(A, 'real');
B = sym('B%d%d', L); B = sym(B, 'real');
for i=1:L for j=1:L if i>j A(i,j)=A(j,i); B(i,j)=-B(j,i); end if i==j B(i,j)=0; end end end
D=A+1i*B;