In general, the syntax for a surf plot is surf(X,Y,Z). I have u = F(r,z). I'd like to do surface plots of u for multiple cross sections at z = h1, h2, h3, etc. Is there a simple way to create a surf plot in cylindrical coordinates, i.e., something that would be analagous to the syntax: surf(r,phi,u) where u = u(r,h1)?

Products

3 Answers

Or even easier, remember that you're not forced to put just one variable X in the first argument of surf, all you need is a parametrization. So in your case, assume you have vectors r and phi. Then make them into a grid, obtain a matrix with z-values using your function F and just plot: