Let $K = \mathbb {F}_q(T)$ be the rational function field over a finite field of $q$ elements. For any polynomial $f(T)\in \mathbb {F}_q[T]$ with positive degree, denote by $\Lambda _f$ the torsion points of the Carlitz module for the polynomial ring $\mathbb {F}_q[T]$. In this short paper, we will determine an explicit formula for the analytic class number for the unique subfield $M$ of the cyclotomic function field $K(\Lambda _P)$ of degree $k$ over $\mathbb {F}_q(T)$, where $P\in \mathbb {F}_q[T]$ is an irreducible polynomial of positive degree and $k>1$ is a positive divisor of $q-1$. A formula for the analytic class number for the maximal real subfield $M^+$ of $M$ is also presented. Futhermore, a relative class number formula for ideal class group of $M$ will be given in terms of Artin $L$-function in this paper.