print an imaginary numberto print an imaginary


Print an imaginary number:

To print an imaginary number, the function disp will show both parts automatically:

>> disp(z1)

   4.0000 + 2.0000i

The function fprintf will print only the real part unless both parts are printed individually:

>> fprintf('%f\n', z1)

   4.000000

>> fprintf('%f %f\n', real(z1), imag(z1))

4.000000 2.000000

>> fprintf('%f + %fi\n', real(z1), imag(z1))

4.000000 + 2.000000i

Request for Solution File

Ask an Expert for Answer!!
Applications of MATLAB: print an imaginary numberto print an imaginary
Reference No:- TGS0175368

Expected delivery within 24 Hours