This Matlab function imports a raw Zemax ray database stored in ZRD file, groups the rays into distinct paths based on i) the exact same sequence of objects hit AND ii) ray events (such as reflection, splitting etc.), and outputs this information in a form of graphs, human-readable variables and, most importantly, a summary table storing each path in descending total power, object sequence, total ray events and so on, which can be further processed either using Matlab's native capabilities, or exported and processed using Excel or a simple text editor.
It DOES NOT need Zemax to be installed onto your system and does not use any API to connect to it. It is a completely standalone function.
The need for this custom function came clear during one project at work as the native Zemax ray paths tool was insufficient. As per official documentation, it now groups it based on the sequence of FACES the rays hit.
In contrast, this function retains a full low-level list of objects and events. It also stores all other ray information (such as phase, direction cosines etc.) for later use, shall the user might need it. At the same time, it provides a high-level overview of interactions in the table. I hope it would be useful for advanced analysis and I would gladly update it based on the feedback.
Although this function is shared free for use and any modification as you might see fit, I would appreciate it if you would quote me in case you are going to use it for any non-personal tasks.