Hi Alfonso,
I understand that you're encountering an error while using the “epanet” function. It is very likely that you might be having trouble with setting up the EPANET-MATLAB Toolkit. I would suggest you ensure that the toolkit is correctly set up by ensuring the following.
Make sure that you have downloaded the latest version of the EPANET-MATLAB Toolkit from the official repository. Extract the ZIP file and save the folder in a convenient location on your computer. Open MATLAB and navigate to the folder where you saved the toolkit. Run the “RunTests.m” script to verify that all the functions are working correctly. This script will execute a series of commands that test the toolkit's functionality.
You can refer to the following documentation for detailed information on “epanet”: https://www.mathworks.com/matlabcentral/fileexchange/25100-openwateranalytics-epanet-matlab-toolkit.