Skip to main content
Solved

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

  • April 19, 2023
  • 1 reply
  • 47 views

  • Monochrome
  • 2 replies

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”.

Best answer by MichaelH

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? 

View original
Did this topic help you find an answer to your question?

1 reply

MichaelH
Ansys Staff
Forum|alt.badge.img+2
  • Ansys Staff
  • 342 replies
  • Answer
  • April 19, 2023

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings