My code computes the real and imaginary parts of V1 as follows:
V1=term1/term3 + term2/term3 * i
fprintf( 'Slope V1 = %.4f\n', real(V1), imag(V1) )
I want to output the complex number V1 as follows:
Slope of V1 = real(V1) + imag(V1) * i
I never seem to get the %4.f notation correct. Can someone give me a start with this, please? I am not sure how to handle the + sign.
V1=term1/term3 + term2/term3 *i
fprintf( 'Slope V1 = %.4f\n', real(V1), imag(V1) )
Outputs
Slope V1 = 0.0000
Slope V1 = 1.4142
I want to have output
Slope V1 = 0.0000+1.4142i
Sincerely, MM