To cite a MATLAB program, use the program name and the "Copyright" line from the program file. You can see this by executing
in the MATLAB Command window. The Copyright line is usually found just below the help text.
If you also used the documentation in your paper or research, you can use the documentation webpage (e.g. https://www.mathworks.com/help/matlab/ref/rand.html ) and follow the standard rules for citing a webpage in whatever convention you are using for your sources.