% ----------------------------------------------------------------------
% MAIN PROGRAM - generated by the Rappture Builder
% ----------------------------------------------------------------------
% open the XML file containing the run parameters
% the file name comes in from the command-line via variable 'infile'
io = rpLib(infile);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Get input values from Rappture
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% get input value for input.number(n1)
n1 = rpLibGetDouble(io,'input.number(n1).current');
% get input value for input.number(n2)
n2 = rpLibGetDouble(io,'input.number(n2).current');
% get input value for input.number(n3)
n3 = rpLibGetDouble(io,'input.number(n3).current');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Add your code here for the main body of your program
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t = linspace(0, 1, 1000);
z = exp(i*2*pi*n1*t) + exp(i*2*pi*n2*t) + exp(i*2*pi*n3*t);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Save output values back to Rappture
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% save output value for output.curve(z)
% this assumes a vector 'x' and a vector 'y'
xydata = [real(z);imag(z)];
str = sprintf('%12g %12g\n', xydata);
rpLibPutString(io,'output.curve(z).component.xy',str,0);
rpLibResult(io);
quit;