surf could be set as an object, following code snippets should do the trick:
[X,Y,Z] = cylinder(R,N);
testsubject = surf(X,Y,Z);
wherein the last number, here I used 0.5, is the alpha value you wanna set, it is between zero and one, in which if set as one the cylinder will be opaque. For example, the cylinder shall look more fancy if you do something like this:
The final output should look like this if playing with the camera angle a little more:
In the MATLAB help browser, simply look for
Figure Properties and
Patch Properties, all the adjustable parameters of the specific object you just draw are included.
Also I wanna point out something extra with respect to the transparency in MATLAB, in MATLAB there are three renderers, the default renderer for outputting the graph on your screen should be OpenGL, while for the
print command, the default renderer is painter, and the painter renderer can not handle the transparency, so be sure to switch to zbuffer or openGL being the renderer when you wanna use the
print command for some eps output.