How to cite a Matlab function I want to cite polyfit function described in : https://www.mathworks.com/help/matlab/ref/polyfit.html

How can I cite it? Specially in bibtex format?

I don't know if I should point to the URL or use MATLAB trademark and the software version...
Since polyfit is a basic Matlab function, you could reference the Matlab Function Reference book (pdf) for the version of Matlab you are using. It would be appropriate to reference the page number of were the function is decsribed in your text. The manual is easily added as a book. The references can be found on the Mathworks web.