The following link contains a paper on “Controlling HEC-RAS using Matlab”
http://authors.elsevier.com/a/1TPra4sKhE9jgA
The link above is valid for 40 days. After this time, the preprint of the paper can be downloaded from:
http://www2.egr.uh.edu/~aleon3/papers_PDF/Journal/HEC_RAS_Controller.pdf
The MATLAB code can be downloaded from:
https://sellfy.com/p/WaVe/
or from
http://www2.egr.uh.edu/~aleon3/Codes.html