Multiplication of real matrices giving a complex matrix

yashas_myashas_m Singapore
edited June 2016 in Matlab

for i=1:957
for j=1:99
%Complete Decomposition Contribution
GDC(j,i)=X(:,i)' * (M_d.^0.5) * eps_d(:,j) * eps_d(:,j)' * (M_d.^0.5) * X(:,i);
denom_d(j,i)=eps_d(:,j)' * (M_d.^0.5) * covar * (M_d.^0.5) * eps_d(:,j);
rGDC(j,i)=GDC(j,i)/denom_d(j,i);
end
end

Dimensions are X: 99 * 957 M_d:99 * 99 eps_d:99 * 99 covar: 99 * 99
All the above matrices and vectors are real but the following part of code when run on Matlab gives me a 99 * 957 matrix which has imaginary values. I cannot find the problem with this code. eps_d is a identity matrix of dimension 99 * 99.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories