I was following the following example for matlab: http://se.mathworks.com/help/matlab/creating_plots/contour-plot-in-polar-coordinates.html. This example works, but when I want to plot my own data, the figure does not change, and I get no output. Plotting my data as usual with contour() works. What am I doing wrong?
Edit: The code from the example is:
th = (0:5:360)*pi/180;
r = 0:.05:1;
[TH,R] = meshgrid(th,r);
[X,Y] = pol2cart(TH,R);
Z = X + 1i*Y;
f = (Z.^4-1).^(1/4);
figure
surf(X,Y,abs(f))
colormap summer;
hold on
surf(X,Y,zeros(size(X)))
hold off
xlabel('Real')
ylabel('Imaginary')
zlabel('abs(f)');
figure
contour(X,Y,abs(f),30)
axis equal
xlabel('Real')
ylabel('Imaginary')
h = polar([0 2*pi], [0 1]);
delete(h)
hold on
contour(X,Y,abs(f),30)
My values are a, b and c, representing a meshgrid (as TH and R do) and c which is a height matrix. I simply replaced the last command:
contour(a, b, c, 30)
a is a 361x361-sized matrix with range from 2 to 226, b the same. c goes from 0.5 to 50 and is 361x361-sized.