In this paper, we approximate the solution of the initial and boundary value problems of anomalous second- and fourthorder sub-diffusion equations of fractional order. The fractional derivative is used in the Caputo sense. To solve these equations, we will use a numerical method based on B-spline basis functions and the collocation method. It will be shown that the proposed scheme is unconditionally stable and convergent. Three numerical examples are adopted to demonstrate the performance of the proposed scheme.