u/BlueHash4

▲ 66 r/matlab+1 crossposts

Hi Folks

We wanted to share a new add-on for MATLAB R2026a to enable optics workflows: the Optical System Design and Analysis Library.

The opticalSystemDesigner App is our main UI front-end, it can load and analyze optical systems (including importing .ZMX files).

Optical System Designer App in MATLAB

We also have an opticalCoatingEditor which allows you to edit optical coatings.

Optical Coating Editor in MATLAB

In typical MATLAB API style, everything has a CLI functional equivalent so you can roll your own workflows and plug in other MathWorks toolboxes.
For example here are a few workflows using MATLAB’s local & global optimization tools:

Optimize Monochromatic Camera Lens System for Type 2/3 Sensor

https://preview.redd.it/8k5q0wjfnyxg1.png?width=560&format=png&auto=webp&s=f5aa468cbc3d86cebfb8411c6092e12a28b41603

Optimize Photographic Zoom Lens Component Positions

https://preview.redd.it/qlig236gnyxg1.png?width=640&format=png&auto=webp&s=fed4ed0b263fdeadf10b308d24010d2d6fc68c96

Optimize Coating Design for Longpass Optical Filter

https://preview.redd.it/47hjtgpgnyxg1.png?width=560&format=png&auto=webp&s=2971a571c9129b58a6380b6f95086bd52b8ac53a

Perform Sensitivity and Yield Analysis of Optical Coating Using Monte Carlo

https://preview.redd.it/j9ckkqghnyxg1.png?width=640&format=png&auto=webp&s=9ce4c75eba211830c09731cba70bebbc8ed71ee8

Even the UI’s are extensible. Here’s an example with a custom live visualization of reflective power plugged into the Optical Coating Editor:

https://preview.redd.it/fs57g27jnyxg1.png?width=640&format=png&auto=webp&s=ef3404661304db78b6deb0393c8df538b61a9663

MATLAB’s detailed documentation makes it a breeze to bring in an agent using MATLAB Agentic Toolkit to create custom UI’s (among other things!). See the video below for a demo. The agent is able to assemble a custom “Angle of Incidence” exploration UI with minimal prompting. We just released this optics library, so the model is not trained on our APIs. But with a top-level index of optics functions, coupled with our strong documentation and cross referencing ‘see also’ links, it is able to progressively discover and use the right functionality. Our error messages also guide the agent when it stumbles (Side note: Our awesome doc team reviews all warning and error messages to be consistent and ‘actionable’!). We designed our API and UI components to follow MATLAB’s consistent design patterns making it ‘fit well’ into the wider MATLAB code and graphics ecosystem, you can see that in action as it figures out how to make the 3D view fill the pane!

Agentic* Optics UI generation in MATLAB

If you already have MATLAB R2026a and the Image Processing Toolbox, download this free add-on. If not, you could kick the tires with a free 30-day trial - remember to download the Image Processing Toolbox too.

We are continuing to work on this, so do let us know if you have any feature requests.
Feel free to post here (to start a discussion), message me, or use our support channel (in case you have sensitive information to share).

 

*Recorded as I walked through it, warts and all. Sped up here and there (note the agent’s ticker). There is a bug visible in the final UI that I missed - see if you can spot it!

reddit.com
u/BlueHash4 — 16 days ago