Hello folks,

I was happy for the fact that I found this website but my excitement didnt last long! I read all of the dicussions here but I couldnt find a post which directly show me how to connect Matlab to SWMM. Yes, you do parallel processing and all of the fancy stuff with SWMM but I still don't know how call the SWMM! I may have missed something.

I'm looking for a sample code to call SWMM from Matlab and do some changes to calibrate and essentially optimize the specific parameters. I think it would be great if someone could write up a little step by step manual and put some example code in this regard. Or even better, it would be awesome if you can make a folder of all the necessary files that are needed to do the job (i.e. swmm dll, example inp file, the m file that calls swmm, ...) and put it somewhere like dropbox for d0wnload.

Hope to hear from you soon,


You need to be a member of SWMM 5 or SWMM or EPASWMM and SWMM5 in ICM_SWMM to add comments!


Email me when people reply –


  • Hello everybody!, I have encountered the same issue in the last year, and because of this I have developed an open source solution to replicate the SWMM algorithm in Matlab, Python, and LabVIEW easily. I have called it MatSWMM an it is available at: https://github.com/water-systems/MatSWMM

    MatSWMM can be useful to model Real-time control for urban drainage systems, extract simulation results and edit systematically a system that has been created with the SWMM platform. I hope this can be useful to fullfil the requirements of the unpleasant batch simulation problems. 

    Please check it out, and feel free to contact me (ga.riano949@uniandes.edu.co) if any doubt or suggestion appears. 

  • We do have a forum for Matlab questions which includes the batch file processing in SWMM 5.

    How to Use the SWMM 5 Dos Engine

    • SWMM Engine Name Name of the SWMM 5 DOS Engine (usually called SWMM5.EXE)
    • SWMM Input File - SWMM 5 Input file
    • SWMM Output File - SWMM 5 Output Binary Graphics File (.OUT Extension)
    • Alternative SWMM Output File - SWMM 5 Output Text File (.RPT Extension)
    • The SWMM 5 Engine is called SWMM5.DLL and is used with the GUI, you need SWMM5.EXE for Batch or Matlab simulation

  • I would be really helped too if someone answers this question
This reply was deleted.