MATLAB: How to generate a rotationally invariant surface from a profile

fittinggridinterpolationpolarvector to matrix

I have a vector, e.g. V = [1 2 3 4 3 2 1], that represents a profile through the center of a rotationally invariant surface. I'm trying to generate a matrix representing the surface.
Alternatively, if there's a spherical cap but all I have is a profile from one edge, through the center, how can I generate the spherical cap from the profile?
Thanks in advance for any help!

Best Answer

Something like this, maybe
radius=length(V)-1;
[X,Y]=ndgrid(linspace(0,radius,100););
R=sqrt(X.^2+Y.^2);
surfaceSamples=interp1(0:radius,V,R(:));
surfaceSamples=reshape(surfaceSamples,size(X));
surf(X,Y,surfaceSamples);