home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / SRC.DI$ / MEXTST1G.F < prev    next >
Encoding:
Text File  |  1993-03-26  |  1.0 KB  |  24 lines

  1.       subroutine MEXFUNCTION(nlhs, plhs, nrhs, prhs)
  2.       integer plhs(*), prhs(*)
  3.       integer nlhs, nrhs
  4.  
  5. c MATLAB's MEX-file facility lets you call your own Fortran subroutines
  6. c directly from MATLAB.   Conversely, it is also possible to call
  7. c internal MATLAB routines from your Fortran routines, using the special
  8. c mexCallMATLAB  utility routine.  In the way of an example, we've put together 
  9. c the subroutine, MEXTST1.F, together with this gateway routine, MEXTST1G.f.
  10.  
  11. c This is the gateway subroutine for linking in our EIGS example.  To
  12. c use MATLAB as a subroutine library, a program must be linked in as
  13. c a MEX-file with MATLAB.  For our EIGS example, we would invoke MATLAB
  14. c and execute the command 'EIGS'.  This transfers control to the EIGS
  15. c program, which can then make calls to MATLAB's internal functions.
  16.  
  17. c Since our program EIGS is stand-alone - it doesn't take arguments from
  18. c MATLAB - the gateway routine doesn't do anything; it just branches to
  19. c the EIG subroutine.
  20.  
  21.       call EIGS(nlhs, plhs)
  22.       return
  23.       end
  24.