% File: program.m (This is a template for a Matlab program (script))  
%
% Purpose
%
% Whatever your program is intended to do.
%
% Pre and Post Conditions
%
% Existance of files (including formats), etc.
%
% Input(s)
%
% User or file inputs. Always include units. Include format for file input. 
%
% Output(s)
%
% Screen or file outputs.  Always include units. Include format for file
% ouput.
%
% Other Variables Used
%
% List and describe all other variables used with units.
%
% Revision History
%
% Created xx/xx/xx by Your Name

%Prompt for and get user input.

dlg_title = 'User Input';
prompt{1} = 'Label: ';
prompt{2} = 'Real part: ';
prompt{3} = 'Imaginary part: ';
answer = inputdlg(prompt, dlg_title);

% Interpret input and build number.

plot_title = answer{1};
z = str2double(answer{2}) + str2double(answer{3})*i;

% Plot point.

plot (z, '--bo');
title(plot_title);
xlabel ('Real Part');
ylabel ('Imaginary Part');
hold on; %prepare to add line

% Add line.

x = [0 real(z)];
y = [0 imag(z)];
plot(x,y);
hold off;

% Calculate and display magnitude and angle.

mag = abs(z);
ang = angle(z);
out_string = sprintf(...
    'Entered magnitude %6.2f units.\n Entered angle %6.2f radians.\n', ...
    mag, ang);
msgbox(out_string);



