A complex number is a number of the form a + ib, where a is called the real part, b is called the imaginary part,
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:8| Question number:16.8
All Answers
total answers (1)
compnumstruct.m
% Prompt the user separately for the real and
% imaginary parts of a complex number, store in
% a structure, and print it
compnum.real = input('Enter the real part: ');
compnum.imag = input('Enter the imaginary part: ');
fprintf('The complex number is %.1f +i%.1f\n', ...
compnum.real, compnum.imag)
need an explanation for this answer? contact us directly to get an explanation for this answer