Hi all,
I am looking to build an API in MATLAB to perform image simulations in Zemax. I am having trouble with the basic case.
My MATLAB Standalone Application:
function ] = BeginApplication(TheApplication, filename)
import ZOSAPI.*;
TheSystem = TheApplication.PrimarySystem;
TheSystem.LoadFile(filename, false);
% Create analysis
im_analysis = TheSystem.Analyses.New_ImageSimulation();
im_settings = im_analysis.GetSettings();
im_settings.OutputFile = 'testfinal.BMP';
im_analysis.ApplyAndWaitForCompletion();
end
If I run this on the “Double Gauss 5 degree field.zmx” sample file, I get an image generated that simply i0,0,0] pixels.
I can run the simulation on the same .zmx file in OpticsStudio without issue.
Any ideas what I am doing wrong?