how to plote 3 variable on 2D plot

1 回表示 (過去 30 日間)
Abdulaziz
Abdulaziz 2013 年 4 月 10 日
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 Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by