MATLAB: Convert cross sectional data into surface

3dplotssurfaceplots

Hi, I have a set of cross sectional data distribution on a certain surface:
[5.8645 11.4836 12.6726 11.587 11.3566 10.2168 9.8317 10.0888 10.6236 10.8221 10.8221 10.6236 10.0888 9.8317 10.2168 11.3566 11.587 12.6726 11.4836 5.8645]
It's symmetrical around the center, how can I create a surface from this data?

Best Answer

Here is one possible approach.
The Code
V = [5.8645 11.4836 12.6726 11.587 11.3566 10.2168 9.8317 10.0888 10.6236 10.8221 10.8221 10.6236 10.0888 9.8317 10.2168 11.3566 11.587 12.6726 11.4836 5.8645];
Av = linspace(-1, 1, numel(V))*(10*pi/numel(V));
Rv = linspace(-1, 1, numel(V));
[R,A] = meshgrid(Rv,Av);
Z = ones(numel(Av),1)*V;
[X,Y,Z] = pol2cart(A, R, Z);
figure
surf(X, Y, Z)
grid on
shading(gca,'interp')
view(-30, 50)
The Plot
You will have to experiment to get the result you want, including labeling the axis ticks as you want them.
This will get you started.