You can refer to this article: https://www.researchgate.net/publication/265400386_CFAR_Algorithm_using_MATLAB, which provides a detailed step for using MATLAB to implement the CFAR algorithm.