Hi. I started to study ZOS-API with Matlab today. And I managed to set a specific material refractive index and get it to work without error. And My goal is to create code that can display PSF,MTF, Thorough Forcus Spot diagram and Zernike Standard Coefficients. Therfore, could you please give me some advice how to analyze them and receive their results in Matlab?
import ZOSAPI.*;
![endif]-->!--[if>
% Set up primary optical system
TheSystem = TheApplication.PrimarySystem;
![endif]-->!--[if>
% Aperture
PupilDia = 8.0;
TheSystemData = TheSystem.SystemData;
TheSystemData.Aperture.ApertureValue = PupilDia / 2;
![endif]-->!--[if>
![endif]-->!--[if>
% Lens data
TheLDE = TheSystem.LDE;
% TheLDE.InsertNewSurfaceAt(2); %
Surface_1 = TheLDE.GetSurfaceAt(1);
Surface_2 = TheLDE.GetSurfaceAt(2);
Surface_3 = TheLDE.GetSurfaceAt(3);
![endif]-->!--[if>
% Surf1 Infomation
Surface_1.Radius = 24.397;
Surface_1.Thickness = 9.915;
%Setting RefractiveIndex
nd = 1.52253;
materialModel = Surface_1.MaterialCell.CreateSolveType(ZOSAPI.Editors.SolveType.MaterialModel);
materialModel.IndexNd = nd;
Surface_1.MaterialCell.SetSolveData(materialModel);
Surface_1.Comment = 'R1';
% Surf2 Information
Surface_2.Radius = -1094764;
Surface_2.Thickness = 0.0;
Surface_2.Comment = 'R2';
![endif]-->!--[if>
% Surf3情報
Surface_3.Comment = 'Image';
% QuickFocus
quickFocus = TheSystem.Tools.OpenQuickFocus();
quickFocus.Criterion = ZOSAPI.Tools.General.QuickFocusCriterion.SpotSizeRadial;
quickFocus.UseCentroid = true;
quickFocus.RunAndWaitForCompletion();
quickFocus.Close();
% Save and close
TheSystem.Save();
r = [];