The chi3d.p is a Matlab class providing all methods and properties included in the chi3D package (see
manual). Just make sure the chi3p.p file is in the current folder or in the Matlab path.
SHG Example:
SHG_obj = chi3D(); %creates an instance of chi3D - without further inputs all properties of the new object are predefined for the standard example generating the second harmonic of a 'pulse1'
[Eftfxfy_o,Eftfxfy_e]=run(obj,{'pulse1'}); %start the computation using the run method of the class


figure('Name','SHG efficiency vs. crystal length');
plot(SHG_obj.simResults.SHGexample_green.z * 1e3 , SHG_obj.simResults.SHGexample_green.PulseEnergy ./ SHG_obj.beamProp.EorI_pulse1)
xlabel('z [mm]');
ylabel('efficiency')
Tino Lang