how to plote 3 variable on 2D plot

16 次查看(过去 30 天)
Hi guys
I have two matrices; one for velocity and the other for depth. these two matrices will generate a curve at particular position where the test was made. Similarly, at every x(i) position we have different curve from different data. I am trying to plot 2D (velocity VS depth) at all position but on the same plot. The problem is I want the x axis to present the velocity and axial distance x(i) and y present the depth. example x=[ 0,1,2,3,4] and at every x value we have D matrix and V matrix. The plot should draw this matrices at every element of x.
Thanks in advance Aziz

采纳的回答

Ahmed A. Selman
Ahmed A. Selman 2013-4-10
But the single x-axis can't hold more than one variable, unless:
  • The two (or more) variables have the same units, as the radius of a sphere (R) and the outward distance (D) from the surface of that sphere, or
  • The two (or more) variables are coupled by a linear equation, as the radius of a sphere (R) and the circumference of that sphere (C=2*pi*R). In this case the scale units might be (arbitrary).
None of these cases apply to your question, since you have velocity (units of length/time) and depth, or axial distance (units of length).
There is a way around it, that is to use two y-axes on a single x-axis (x and V, x and D). For such case use
plotyy(x1, D, x2, V)% two x-axes, two y-axes. Or
plotyy(x, D, x, V)% one x-axes, two y-axes.
and always note that (x, D and V) must have the same sizes.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by