A major challenge to implement the compressed sensing method for channel state information (CSI) acquisition lies in the design of a well-performed measurement matrix to reduce the dimension of sparse channel vectors. The widely adopted randomized measurement matrices drawn from Gaussian or Bernoulli distribution are not optimal. To tackle this problem, we propose a fully data-driven approach to optimize the measurement matrix for beamspace channel compression, and this method trains a mathematically interpretable autoencoder constructed according to the iterative solution of sparse recovery. The obtained measurement matrix can achieve near perfect CSI recovery with fewer measurements, thus the feedback overhead can be substantially reduced.