In recent years, underwater robots that propel and maneuver themselves like real fish, often called robotic fish, have emerged as promising mobile sensing platforms for freshwater and marine environments. For these active monitoring applications, efficient exploration along with economical locomotion is highly important, in order to optimize sensing coverage and guarantee long field operation time. As a result, optimization of the sensing trajectory and energy-saving tracking of the planned trajectory are of interest. In this paper we adopt an ergodic exploration method to calculate an optimal sensing trajectory for a tail-actuated robotic fish, and propose a nonlinear model predictive control (NMPC) approach for tracking the generated trajectory. A high-fidelity, averaged nonlinear dynamic model is used for trajectory planning and control. In particular, the bias and amplitude of the tail-beat pattern are treated as the control inputs, and their physical bounds and the constraints on their changing rates are properly accounted for in the optimization process. Finally, simulation results are presented to illustrate the effectiveness of the proposed approach.