Thank you Deepak, I found this really usefull solution
function [matrixZ,Zplanes] = denoising3D (matrix,planes);
Zplanes = planes * 7;
B = imgaussfilt3(matrix);
[r,c,z] = size(B);
matrixZ = zeros (r,c, Zplanes);
for i = 1: r
img(:,:) = B(i,:,:);
imgZ = imresize(img, [c Zplanes]);
matrixZ(i,:,:) = imgZ;
end
end
imgaussfilt3 is a new volumetric function implemented in the last version of image processing toolbox that is brilliant! And for the rescalig I threated the volume as a group of slice using imresize. In this way I reduced the computational time of 100 about times