Question

I have Matlab 2010b and Microsoft VS2010.

For project related reasons I need to use alternatively the 32 and 64 bit version of Matlab.

I currently have two mexopts.bat files that I rename depending on the Matlab version I use to correctly link to the relevant compiler.

Is there a way to have a single file with links to both compilers and have Matlab automatically pick up the relevant one?

Was it helpful?

Solution

Thanks to Peter's comment, I investigated the command line options.

An automatic way of doing what I need is:

version = mexext;

if (version(5) == '3') % this is 32bit

    % include 32bit version code

elseif (version(5) == '6') % this is 64bit

    % include 64bit version code

else

    % deal with problems (should never occour)

end

the mex command(s) will have to include the option -f $full_path_to_correct_mexopts.bat

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top