How to implement MFD discrete filter in simulink

I'm in need of implementing such a discrete filter in Simulink which is described below:

Output=L(z^-1)*input; where input is a 1-by-n vector and L(z^-1), in which z^-1 is the unit delay operator, is:

L(z^-1)=L0+L1z^-1+L2z^-2+....+Lmz^-m;

where Li(i=1...m) is n-by-n Matrix of scalar elements. The main constrain preventing me to do it so far is that it must be implemented in a general way. That means, the parameters n,m, could be changed easily any need to block diagram reconstruction.

I've been unsuccessfully trying to do this through variety of discrete filters and transfer function blocks available in Simulink library. Any Idea?