In this paper, a data-based method is developed for analyzing the controllability and observability of discrete-time linear systems in noisy environment. This method uses measured data to estimate the controllability matrix and the observability matrix without identifying system models. The unbiasedness and consistency of this estimate with measurement noise and system noise are proven, respectively. As the estimated error of system parameters will not accumulate in calculating the controllability matrix and observability matrix, this method has a higher precision than traditional methods, especially in high-dimensional state space. In the simulation, the advantages of the data-based method in accuracy and convergence are illustrated.