Summary: A new method that enables easy and convenient discretization of partial differential equations with derivatives of arbitrary real order (so-called fractional derivatives) and delays is presented and illustrated on numerical solution of various types of fractional diffusion equation. The suggested method is the development of the first author’s matrix approach [Fract. Calc. Appl. Anal. 3, No. 4, 359–386 (2000; Zbl 1030.26011
)]. Four examples of numerical solution of fractional diffusion equation with various combinations of time-/space-fractional derivatives (integer/integer, fractional/integer, integer/fractional, and fractional/fractional) with respect to time and to the spatial variable are provided in order to illustrate how simple and general is the suggested approach. The fifth example illustrates that the method can be equally simply used for fractional differential equations with delays. A set of MATLAB routines for the implementation of the method as well as sample code used to solve the examples have been developed.