%  This script demonstrates the used of mfiles
%  GETCURVES and INTERPCURVES for opening the
%  Transfer Characteristic for a diode from the
%  Curve Tracer and converting it to vectors
%  representing the x axis (vd) and y axis (id).
%
%  It needs the CSV data  file 'E121600E.CSV' in the 
%  Current director to run

%  Open CSV curve from Curve Tracer Output File 
fname = ['E121600E.CSV'];
c = getcurves(fname);
%  Convert Cell Array to vector
[id, vd] = interpcurves(c);
% Plot it for observation
figure(1)
plot(vd,id*1000)
title('Diode Transfer Characteristic')
xlabel('V_d in Volts')
ylabel('i_d in milliamps')
