MATLAB: Radial vector to circular plot

array to circleimagescopticsradial plot

Hello all,
I have a 5001 x 1 vector which contains information about the intensity of a radially symmetric object. I would like to make an intensity plot of the circular object, preferably with imagesc, which would look like a circle with a radius of 5001.
The general shape would look somewhat like the contour plot below but I'm looking for a way to get the actual values to show, not a contour plot.
Thanks

Best Answer

My question has been answered somewhere else:
% Construct quarter slice
n = length(I)
I = [I;zeros(n,1)];
[X, Y] = meshgrid(1:n, flip(1:n));
r = round(sqrt(X.^2 + Y.^2));
A = reshape(I(r(:)), n, n);
% Plot whole beam slice without doubling
imagesc([fliplr(A) A(:,2:end) ; fliplr(flipud(A(2:end,:))) flipud(A(2:end,2:end))]);
colorbar; xlim([0 2*num-1]);ylim([0 2*num-1]);