I have a matlab code but at the middle of code I need to use fortran for 'dgels' command.
Is there any way to make this fortran code useful in matlab? Now I run 3 different code (matlab-fortran-matlab). Any tutorials about creating a mex file for matlab? I searched a lot but couldnt find a good tutorial about it.
I use microsoft visual studio 2013, matlab r2016a and intel visual fortran compile 126.96.36.199.
Matlab already uses Lapack, and has done so for a number of years. See https://www.mathworks.com/company/newsletters/articles/matlab-incorporates-lapack.html . When you write in Matlab "x = A \ b", and A has more rows than columns, the actual calculation may well be performed by GELS in one of the DLLs.