I don’t have your wing section or your code creating it, so I created something that resembles it (the (2xN) ‘y’ matrix has the upper wing profile in the first row and the lower wing profile in the second row), then did the plot:
x = linspace(0, 1, 100);
y = [x.*exp(-8.0*x); -x.*exp(-8.0*x)];
figure(1)
plot(x, y)
grid
figure(2)
surf([x; x], [y(1,:); y(1,:)], [zeros(size(x)); ones(size(x))])
hold on
surf([x; x], [y(2,:); y(2,:)], [zeros(size(x)); ones(size(x))])
hold off
grid on
The Plot —
You will have to adapt this to your own code, but it should not be difficult. You simply have to put your wing profiles in the rows of the ‘y’ matrix, and use the ‘x’ you used to plot your 2-D plot as the independent variable.
(I admit to a bit of cheating. I looked at the way the cylinder function creates its cylinder, then adapted that idea to plot your wing section.)
EDIT —
I found some code for a NACA airfoil, so adapted my earlier code to it. The airfoil is plotted horizontally in figure(2). Note the rotate calls after the plot.
Airfoil Code (Archive) —
c=1;
s=num2str(2412);
NACA=s;
d1=str2double(s(1));
d2=str2double(s(2));
d34=str2double(s(3:4));
m=d1/100;
p=d2/10;
t=d34/100;
x=linspace(0, c, 250);
yt =5*t*c*(.2969*(sqrt(x/c))+-.1260*(x/c)+-.3516*(x/c).^2+.2843*(x/c).^3+-.1015*(x/c).^4);
for k = 1:length(x)
if x(k) <= p*c
yc(k)=m*(x(k)/p^2)*(2*p-(x(k)/c));
dx(k)=(2*m)/p^2*(p-(x(k)/c));
elseif x(k) > p*c
yc(k)=m*((c-x(k))/(1-p)^2)*(1+(x(k)/c)-(2*p));
dx(k)=((2*m)/(1-p)^2)*(p-(x(k)/c));
end
theta=atan(dx(k));
xu(k)=x(k)-yt(k)*sin(theta);
yu(k)=yc(k)+yt(k)*cos(theta);
xl(k)=x(k)+yt(k)*sin(theta);
yl(k)=yc(k)-yt(k)*cos(theta);
end
plot(xu,yu)
hold on
plot(xl,yl,'r')
plot(x,yc,'g')
axis equal
grid
figure(2)
hu = mesh([xu; xu], [yu; yu], [zeros(size(xu)); ones(size(xu))]);
hold on
hl = mesh([xl; xl], [yl; yl], [zeros(size(xl)); ones(size(xl))]);
hold off
grid on
axis([0 1 -0.4 0.4 0 1])
rotate(hu,[1 0 0], 90)
rotate(hl,[1 0 0], 90)
title('NACA 2412 Airfoil')
The Second Plot —