2
votes

I am working on a MATLAB project which we want to export as .exe. The resulting file must then be able to run on both 32 and 64-bits Windows 7 PCs.

After a little research we realized this problem was easier to approach by developing on a 32-bit version of MATLAB building then a 32-bits .exe file.

Till this point, all our development was being carried in the 64-bits version of MATLAB. With it we had been able to successfully generate and run 64-bits .exe versions.

Now that we switched to MATLAB 32-bits, however, and we generate the .exe, something goes wrong and the following error is shown:

Undefined function ‘fmincon’ for input arguments of type ‘function handle’.

This is the line of code in which fmincon first appears:

Options = optimoptions('fmincon', 'DiffMinChange', 10);

A few remarks:

  1. The same scripts which worked on MATLAB 64-bits also work on MATLAB 32-bits. Within the MATLAB environment, everything runs smoothly.
  2. The scripts (with the same exact code) can still be made executable on MATLAB 64-bits without any problem.
  3. In both cases, we properly installed the runtime required for the MATLAB executable to be run on the PC.
  4. We have tried to run the 32-bits .exe in both 64-bits and 32-bits machines with the same result.

Is it possible that the 32-bits version of MATLAB's deployed executable has problems dealing with functions from the Optimization Toolbox (as fmincon is)?

What else could be the cause of this problem? Does anyone have an idea how to fix it?

1

1 Answers

1
votes

The problem was only solved thanks to MATLAB's support. This is related to a bug in version R2014a, explained and patched in this Mathworks link.