Hello,
Currently I have a program in MATLAB ZOS-API that involves a light source that is shining on an array of detector rectangles. The purpose of the for loop is to tilt the X and Y component of the light source then read out the total power from each detector. The problem I am having is how to extract the data efficiently without opening a new detectorviewer each iteration. Currently I am having the for loop run a new ray trace as well as a newanalysis command which I believe is responsible for opening a new detectorviewer each iteration. Ideally the code would just update one detectorviewer or not open one at all to save me computing time. I will attach a snip of my current for loop where I believe the problem resides.
I have tried to follow along to this link: Methods for extracting detector data through the API | Zemax Community… But not much success is being had.
Any and all help would be greatly appreciated!