MATLAB: Trying to plot a radial contour

contourplottingsubplot

I am trying to plot a 2×2 contour subplot, it is supposed to be circular, but I either get lines or no plot at all or an error saying my z needs to be a 2×2 array.
function F = ratio_rp_bf(R,theta,bD)
for r = 1:length(R)
for b = 1:length(bD)
F(b,r) = (16/3).*(1./bD(b)).*(1./R(r)).^3.*abs(sqrt((1./R(r)).^4-2.*(1./R(r)).^2.*cos(2.*theta(r))+1));
end
end
bD = [0.1, 1.0, 10, 100];
R = (1:1.25:5);
c = R;
a = 1/2*bD;
b = abs(sqrt(c.^2 - a.^2));
theta = abs(atan(b./a));
[F] = ratio_rp_bf(R,theta,bD);
for b = 1:length(bD)
figure(1)
subplot(2,2,b)
x = R.*cos(theta);
y = R.*sin(theta);
z = F;
[x,y,z] = meshgrid(x,y,z);
[C,h] = contour(R,theta,bD,x,y,z);
clabel(C,h);
grid on
end

Best Answer

You try to visualize the contours of a 2 x 2 image. That should most likely look degraded. And note that for the values chosen each row is simply 1/10 of the previous row:
F(b+1, r) = F(b, r)/10
Is this correct?