0

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?

2 Answers 2

2

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?

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks, much appreciated. I have three spatial coordinates, x, y, z and three velocity components vx, vy, vz. It describes the flow around a car, so my data is taken from the surface of the car -- and I basically want the direction and magnitude of the velocity shown. coneplot actually looks promising for this, what do you say?
@BillyJean: Yes, that one is made for this :)
Great, thanks for pointing me in that direction. In the example they use matrices, and not vectors though? Do you have a MWE? Thanks so far, really pushed me forward.
0

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

1 Comment

This is only useful if the data forms a surface rather than a volume. If there are multiple z values for each x-y pair, then you can't use this approach.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.