Matrices of complex numbers multiplication
The line
                fscanf(sensorInput, &quot;%lf + j*%lf\t&quot;, &amp;x[i]); 

should be
                fscanf(sensorInput, &quot;%lf,%lf\t&quot;, &amp;x[i].real, &amp;x[i].imag); 

Notice that C++ provides complex type, they support the common complex operations, and provide an io, and they can read complex numbers writen as (1,3) directly file_in &gt;&gt; x[i], once you have a istream
Note that this type of question you should ask in stackoverflow instead.