The error-message is pretty precise. If you want to plot a surface you need a z-hight for every (x,y) position. Thats why it needs to be a 2D matrix.
If I understand correctly, you want to calculate the capillary pressure with regards to width, height and angle:
This does not result in a surface, but rather in a volume. You should take a look in this documentation about visualizing 4D-Data: https://ch.mathworks.com/help/matlab/visualize/visualizing-four-dimensional-data.html
[X, Y, angle] = meshgrid(50:3.8462:400,30:0.3297:60, 30:0.3297:60); % 3D-meshgrid
gamma = 72.2 * 10^-3;
dynamic_viscosity = 1.003 * 10^-3;
Pc = abs(((2 .* cosd(angle))./(X .* 10^-6) + ((cosd(angle) + cosd(angle))./(Y .* 10^-6))).*gamma) ./ 1000;
figure;
xslice = [50 200]; yslice = 45; zslice = [31 45]; % define the cross sections to view
slice(X, Y, angle, Pc, xslice, yslice, zslice) % display the slices
shading interp % this removes the mesh/grid lines (also try removing this line)
xlabel('Channel width [µm]', 'FontSize', 10);
ylabel('Channel height [µm]', 'FontSize', 10);
zlabel('Angle', 'FontSize', 10);
cb = colorbar;
cb.Label.String = 'Capillary pressure [kPa]';
title('Influence of channel height and width on capillary pressure', 'FontSize', 10);