Question

I have data on the form (x, y, z, v), in other words three spatial coordinates and one velocity magnitude. I would like to plot this in 3D, where the velocity magnitude is shown using color.

What is the best way to do this in MATLAB?

Was it helpful?

Solution

I assume you have trajectory data, so that your spatial coordinates represent the trajectory through space of one or more particles. In that case:

Have a look at quiver3 or coneplot.

If you want colored arrows, then have a look at quiver3d or quiverc (2D only) on the File Exchange.

If you only have 3 spatial coordinates and speed (= velocity magnitude), then your best bet is scatter3.

I could go on, but could you give me a bit more detail on what you want exactly?

OTHER TIPS

Have you tried surf(x,y,z,v)?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top