This paper presents a novel rehabilitation approach for guiding patients with stroke to execute correct rehabilitation exercise. First of all, a therapist will hold a patient's hand to practice a correct rehabilitation exercise to build a template for the assigned excercise. The recorded template will be a sequence of sensed data acquired from the inertial measurement units (IMUs) attached on the arm of the patient. Then the patient will practice the assigned exercise alone to generate the testing sequence with a screen. Finally, a dynamic time warping (DTW) algorithm will adopted to measure the similarity between the template and the testing sequence. The rehabilitation system will issue an alarm signal whenever the similarity value is below a pre-specified threshold.