Solved

Problem with Matlab code or difference between files in the samples directory with the extensions .zmx or .zos?

  • 19 April 2023
  • 1 reply
  • 31 views

Load the following file into Matlab. “MATLABStandalone_02_NSC_ray_trace.m”

Go to line 39 and change the file extension from “ .zos” to “.zmx”.

File with the name Digital_projector_flys_eye_homogenizer.zos and Digital_projector_flys_eye_homogenizer.zms exist in the SamplesDir.

The Matlab code will fail at line 50. It will not fail if the extension is “.zos”.

icon

Best answer by MichaelH 19 April 2023, 20:34

View original

1 reply

Userlevel 6
Badge +2

Hi Donald,

The default sample code works for me with both the ZMX and the ZOS.  I’m using Ansys Zemax OpticStudio 2022 R2.0 to run the Matlab code.  Can you a) verify the Digital_projector_flys_eye_homogenizer.zmx actually exists and b) that the ZMX version is the same as the ZOS version (you can open the ZOS version, go to Save As, and then select ZMX as the file extension).  This second part will ensure you are running the sample code against the exact same file and you haven’t accidentally overwritten the ZMX version with a file that won’t run the code (i.e., there are no detectors in the ZMX version).  

If this still fails, can you ZIP & upload your .M, .ZOS, and .ZMX files to check if there are other inconsistencies.  What version of OpticStudio are you using? 

Reply