To use MATLAB from within the Fortran programming environment, use the MATLAB Engine API for Fortran which uses the Fortran Matrix API.