File Exchange

image thumbnail


version 2.1.0 (6.36 MB) by

A Matlab class for EPANET water distribution simulation libraries



The EPANET-Matlab Toolkit is an open-source software which operates within the Matlab environment, for providing a programming interface for the latest version of EPANET, a hydraulic and quality modeling software created by the US EPA, with Matlab, a high-level technical computing software. The goal of the Matlab Class is to serve as a common programming framework for research and development in the growing field of smart water networks.
The EPANET-Matlab Toolkit features easy to use commands/wrappers for viewing, modifying, simulating and plotting results produced by the EPANET libraries

Comments and Ratings (14)

@Very Tary, EPANET splits the time step when a hydraulic change is made. So you may have extra instances (e.g. 12:00, 13:00, 13:15, 14:00) if at time 13:15 a tank status has changed. Please keep track of the time using the toolkit.

Very Tary

Hi! Great tool!
I'm trying the example script "simepa.m" (folder "example"). I wonder the difference between the output data in the workspace "hydraulics" and "results". Why the "hydraulics" struct has more rows then "results" struct, even if the time series is fixed?

Thank you for your effort!


Thank you for your efforts and I'd like to receive your advice.
When I run EPANET-Matlab-Toolkit, the error message is occurred as below,

Warning : Folder "64bit" does not exit.
> In epanet (line 408)

What's is the problem?


any one have tutoriel to call epanet in matlab

how to call epanet in matlab

@Karwan Ali: you need to run

>>mex -setup

and select a compiler (e.g. Microsoft Windows SDK 7.1)

Have a look at this link:

Karwan Ali

Please,I have the following error, what does it means?. Thank you

Error using loadlibrary (line 254)
A 'Selected' compiler was not found. You may need to run mex -setup.

Error in epanetloadfile (line 3)

Chris Kelley

Thank you for this tool. I've noticed that the full hydraulic analysis report output by the toolkit (set with ENsetstatusreport(2)) seems to be very different from the full report output by EPANET (in Report >> Full...). Is there an easy way to get all the data in the EPANET full report via this toolkit?

Your advice is greatly appreciated.



i want to use optimization also here, i want to keep the elevation of the nodes and the diameter of the pipes as variables in the input file. How can i do it?


can you tell me how to install this file?


david (view profile)

fantastic tool!

Kegong Diao

Thanks a lot!



Link to the OWA repository.


updated figure


Version 2.1 includes enhanced capabilities for visualizing the network, for executing EPANET/EPANET-MSX functions. The user can execute step-by-step hydraulic and quality analysis, or in batch using the binaries.


Change in the description


Notify for a bug in setdata.m, regarding control modification


1. Added instructions on how to run the example by downloading EPANET.DLL
2. Changed the copyright file


Removed epanet.dll file


Philip Jonkergouw is now properly acknowledged!

MATLAB Release
MATLAB 8.5 (R2015a)

Inspired: EPANET Info from INP files, KIOS-Research/EpaGui

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today