I have added a few lines of code in the MATLAB program to rotate the 2D curve into a 3D object.
The entire code is below. I have adjusted the number of points in THETA and the repmat to be the same.
PI = 4.0*atan(1.0);
E = 120.0*PI;
L=1/4;
A = L*PI;
Io = 1;
r=2;
k=2*pi;
THETA=0:0.1:2*pi;
U =((cos(k/2*L.*cos(THETA))-cos(k/2*L))./sin(THETA)).^2*(E./(8.0*PI^2));
U = U/max(U);
[X,Y] = pol2cart(THETA,U);
xr = X.'*cos(THETA);
zr = X.'*sin(THETA);
yr = repmat(Y.',1,63);
surf(xr,zr,yr)
axis equal