# a circular plot from a vector which represents the temperature along the radius surface, which is the same for every radius

I have calculated the temperature of the section of a cylinder, which is subjected to a heat flow on its upper surface. Getting the temperature distribution in the 2D section. As shown in the following image.

From this temperature distribution would represent the upper part of the cylinder as in the picture below.

• Welcome to SciComp! What question are you asking here? – Geoff Oxberry Aug 22 '14 at 0:12
• I am looking for a circular surface which represents the top of the cylinder starting from the temperature distribution. And represent it in Matlab. Thank you for your attention – Santiago murillo Aug 22 '14 at 0:32
• I still don't understand what you want to do. Can you be more specific? Do you have an example that looks like what you want? – nicoguaro Aug 22 '14 at 1:29
• The first image is the temperature distribution that I generated using finite volumes, and the second image is not mine, is the image that I want to generate. – Santiago murillo Aug 22 '14 at 8:57
• Basically my problem is that I don't know how program it in matlab, from an array of surface temperatures. – Santiago murillo Aug 22 '14 at 14:00

If I understand, what you want is to make a polar plot of your data presented in the first image. Where, I assume, the axis are the radius and angle. You need to make a change of coordinates from polar to Cartesian to do that. Matlab has a built-in function for that called pol2cart (documentation). See an example here

You can do something like

r = linspace(0,1,1000);
th = linspace(0,2*pi,1000);

[TH,R] = meshgrid(th,r);
[X,Y] = pol2cart(TH,R);

Z = besselj(0,20*R);

figure
contourf(X,Y,Z); axis square

figure