function [m,c,k,b1,b2,f1,f2,g1,g2,d11,d12,d21,d22] = getBlockData(D)
% Extract matrices partitioned according to internal delays.

%   Copyright 2020 The MathWorks, Inc.
k = D.k;
c = D.c;
m = D.m;
if isempty(m)
   m = speye(size(k));
end
b = D.b;
f = D.f; g = D.g;
d = D.d;

% Dimensions
nfd = length(D.Delay.Internal);
[rs,cs] = size(d);
nu = cs-nfd;
ny = rs-nfd;

% Partition matrices
b1 = b(:,1:nu);
b2 = b(:,nu+1:cs);
f1 = f(1:ny,:);
f2 = f(ny+1:rs,:);
g1 = g(1:ny,:);
g2 = g(ny+1:rs,:);
d11 = d(1:ny,1:nu);
d12 = d(1:ny,nu+1:cs);
d21 = d(ny+1:rs,1:nu);
d22 = d(ny+1:rs,nu+1:cs);
