Plotting 3 axes (y1, X1, X2) using 4 fields in a structure?

1 回表示 (過去 30 日間)
jamie rayment
jamie rayment 2020 年 4 月 23 日
回答済み: Ganesh Regoti 2020 年 4 月 27 日
I cannot seem to plot 4 field arrays.
Using the arrays embeded in the structure, where the array of each is the same:
field(1).deflection_x
field(1).deflection_y
field(1).time
field(1).height
Creating a figure, field(1).deflection_x, and field(1).deflection_y are on the same scale of +/-1, therefore, only one y-axis is needed with scale +/- 1.
The deflections occur at linked time(n) and a height values (n), so XAxis 1- states time, and XAxis 2-states height.
So far, I can create a figure using 3 sets of arrays using field(1).deflection_x, field(1).deflection_y and field(1).height. This gives two axes, an X-axis (height) and a Y-axis (deflection).
At the moment, everything I have tried to encorporate field(1).time into the figure as a 2nd X-axis (time), does not work.
Any suggestions?
  2 件のコメント
KSSV
KSSV 2020 年 4 月 23 日
YOu have a area to plot or a curve? Read about surf, scatter.
jamie rayment
jamie rayment 2020 年 4 月 23 日
編集済み: jamie rayment 2020 年 4 月 23 日
Thank you for your response.
I am doing a 2-dimensional line plot, where line_1 is the field(1).deflection_x against field(1).height, and the line 2 is field(1).deflection_y against field(1).height.
Using field(1).time instead of field(1).height for both lines I can produce a displacement over time line plot. This produces an identical graph to displacement against field(1).height.
My issue is that I cannot find a way to produce a single line plot figure with both field(1).time and field(1).height stated on the X-axis (Top and bottom), for the corresponding displacement values on the y-axis.
It would be easier to have 1 figure than two.
As the arrays are identical sizes, each data point should have a corresponding value, so this should be achievable.

サインインしてコメントする。

採用された回答

Ganesh Regoti
Ganesh Regoti 2020 年 4 月 27 日
Hi,
I assume you want two different plots on a single figure. Here are certain links which you could refer to
Hope this helps!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTwo y-axis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by