# How to plot a function which is in cylindrical coordinates - A 3D plot?

19 visualizzazioni (ultimi 30 giorni)
aneps il 26 Mag 2015
Commentato: Walter Roberson il 27 Mag 2015
I am learning about traps in physics. I want to plot the following function on Matlab to visualize (A 3D plot):
F(r,z) = k/2 (z^2 - r^2/2) + k/2 * R^2 * ln(r/R) + C
This is in cylindrical coordinates. Let us take constants k=1, R=1 and C=1.
After plotting this, I want to plot one more thing,
z(r) = [r^2/2 - R^2/2 + R^2 *ln(R/2)]^0.5.
My aim is to visualize F(r,z) and z(r).
These equations are related to an ion trap mass spectrometer called Orbitrap.
##### 0 CommentiMostra -1 commenti meno recentiNascondi -1 commenti meno recenti

Accedi per commentare.

### Risposta accettata

Walter Roberson il 26 Mag 2015
If you are willing to work inside a MuPAD notebook, then you could use Plot::Cylinder. I do not know if those plots can be exported as MATLAB objects.
Otherwise, use pol2cart() on your [theta,r] coordinates to get [x,y] coordinates, and then use your defined z for the z coordinate.
##### 2 CommentiMostra 1 commento meno recenteNascondi 1 commento meno recente
Walter Roberson il 27 Mag 2015
MuPAD is the formal name of the Symbolic Toolkit implementation. When you have that toolkit installed there are a number of interface routines that take care of communicating with MuPAD automatically, but from time to time in order to access functionality there is no interface for, you need to
I have never had access to the MuPAD version of the Symbolic Toolkit (I used to have the Maple based Symbolic Toolkit), so one of the things I do not know is whether you can call upon the MuPAD graphics from MATLAB using evalin() or feval(). Possibly you would just get back the graphics data structure without it being drawn. (MuPAD plots are represented as data structures that can be manipulated as data, with the user interface having special rules about how to display those kinds of data structures.)

Accedi per commentare.

### Categorie

Scopri di più su 3-D Function Plots in Help Center e File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!