Ansys Products

Ansys Products

Connect MATLAB to Lumerical

Tagged: ,

    • mwhitby
      Subscriber

      Hi! I'm trying to connect my 64-bit MATLAB 2020b to Lumerical so that I can use the matlab(); script command in Lumerical. I tried following the instructions on this page https://support.lumerical.com/hc/en-us/articles/360026142074-MATLAB-script-integration-configuration-guide.

      I tried to find the libeng file indicated in Lumerical MATLAB setup but I could not find it and it was not found automatically. I then tried to register the MATLAB software as an automation server by using the !matlab/regserver command in MATLAB as recommended but MATLAB just says busy and never does anything with it (even after several hours). I then went straight to the command window and input "C:Program FilesMATLABR2020binwin64matlab"/regserver. This gave me the error "Unable to set Registry value for SoftwareClassesCLSID{6B213DCC-D6A6-472B-8E06-472B-8E06-5A84313EFE46}.You may not have sufficient privileges. Re-run MATLAB as a user with Administrator access" However I am the administrator on the computer and I ran it under my account. I also have MATLAB set so it automatically runs as administrator.

      I'm wondering if my problems are happening because of the version of MATLAB I am using. Should I revert to the 2019 version and try again? I just wanted to check before committing to uninstalling and reinstalling MATLAB. Thank you!

    • mwhitby
      Subscriber
      Update: I've deleted the MATLAB 2020b version and downloaded the MATLAB 2019a version because it said it should be supported via Lumerical , however I am still having the exact same problems as above. Any assistance is greatly appreciated. Thanks!
    • Lito Yap
      Ansys Employee
      From the guide. The path for Matlab 2019a would be:
      "C:\Program Files\MATLAB\R2019a\bin\win64\libeng.dll"
      To register Matlab: Open a Windows command prompt as Administrator and run the command:
      "C:\Program Files\MATLAB\R2019a\bin\win64\matlab" /regserver
      Then you can test "Lumerical to Matlab" integration by running a matlab plot script:
      matlab("plot(1:10)");
      For the "Matlab to Lumerical" integration route: Aside from adding the Lumerical install path into Matlab. Also add the Matlab install path and Lumerical install and API path into your system. See this post for details.
      Then do the test for the Matlab to Lumerical integration as shown in the guide.
      Hope this helps.
    • mwhitby
      Subscriber
      Hi Lito thank you for your response. It turns out there was still a MATLAB 2020 file on my computer and I didn't realize it. Once it was deleted the connection worked.
    • Lito Yap
      Ansys Employee
      Glad to hear this!
Viewing 4 reply threads
  • You must be logged in to reply to this topic.