I'm trying to combine two columns from two arrays to form a complex number. I know I can create a complex number using the complex(a,b) function and I think I am correct in addressing each column in the two arrays as S21real(:,2) and S21imag(:,2). As a results my code looks like
S21complex = complex(S21real(:,2), S21imag(:,2));
Where my data looks like
S21real:
690000000 0.00854245859320000 0690193750 0.00915901995335000 0690387500 0.00963277694145000 0
S21imag:
690000000 0.00854245859320000 0690193750 0.00915901995335000 0690387500 0.00963277694145000 0
However, when I run the code, I get the following error:
Error using complexReal input A must be numeric, real, and full.
Can anyone shed some light as to where I am going wrong?
Best Answer