What does it mean to extract a specific matrix?
p = 1;
z = 1;
A = D(:,:,:,p,z);
is a matrix of the desired size, extracting the (p,z) submatrix from D. But you may mean something completely different.
For the latter, you need to learn how to use squeeze.
x = 1;
y = 1;
B = squeeze(D(:,x,y,:,:));
Time to read the manual for you, since you need to learn about indexing matrices, something basic.