# Matlab Driven Optimization: Mex file entry point is missing

#1

Hello everybody,

I am currently trying to optimize a nanoantenna using the FDTD module.
Since I am using nonlinear constraints, I tried to do the optimization in Matlab, as explained here, but when I try to run it, Matlab just shows the error

Mex file entry point is missing.  Please check the (case-sensitive)
spelling of mexFunction (for C MEX-files), or the (case-insensitive)
spelling of MEXFUNCTION (for FORTRAN MEX-files).
Invalid MEX-file 'C:\Program Files\Lumerical\FDTD\api\matlab\appopen.mexw64':


The file does exist, and even when running the script as administrator the error shows up. I am using Matlab R2014b and the newest Lumerical version.
Is this due to a version incompatibility or is there another way to resolve this?

#2

Dear @eelco.empting

I haven’t faced this problem before. Can you please attach your simulation file and all the Matlab files that you use?

Thanks

#3

I’m facing the same problem as @eelco.empting with MODE Solutions.

I am using Matlab R2011b and MODE Solutions 2017a R3 (v7.9.1072). When I ran the code below, Matlab gave the same error.

API_path = 'C:\Program Files\Lumerical\MODE\api\matlab';
path(path, API_path);
h = appopen('mode');

#4

Dear @sd15409 and @eelco.empting

I finally could replicate the problem and luckily found a workaround for the problem.

This seems to be a problem with the latest software release. The workaround is to either use 2016b or for an easier way, replace the attached files (in the provided link below) with the files inside matlab api file in the C:\Program Files\Lumerical\FDTD\api\matlab directory. You will need to do the same with other products (MODE for example) if you want to use Matlab api.

#5

Dear @eelco.empting