MATLAB: Configuration of lapack and blas in matlab

blasconfigurationlapackmex

I want to use Matlab for mex files using lapack or blas library.. I have no idea how to configure matlab for blas or lapack

Best Answer

MATLAB ships with BLAS and LAPACK libraries. E.g., on Windows for 64-bit Microsoft compilation, you can typically find them here:
lib_blas = [matlabroot '\extern\lib\win64\microsoft\libmwblas.lib']
lib_lapack = [matlabroot '\extern\lib\win64\microsoft\libmwlapack.lib']
To link your code with these, you can just do this:
cfilename = 'my_mex_name.c';
mex(cfilename,lib_blas,lib_lapack);