Multiplying complex matrices in Matlab
问题 I'm trying to port a code from matlab to C. In order to convert this line to C: A = E*[SOLS' ; ones(1,10 ) ]; Where, >>size(SOLS) ans = 10 3 and: >> size(E) ans = 9 4 SOLS is a complex single matrix and E is a real single matrix and A should be a complex single matrix of size 9x10. I replaced A = E*[SOLS' ; ones(1,10 ) ]; with for i=1:9 for j=1:10 A1(i,j)=E(i,1)*SOLS(j,1))+E(i,2)*SOLS(j,2))+E(i,3)*SOLS(j,3))+E(i,4); end end The complex resultant matrix elements have the same real part as A