フィルターのクリア

How can I plot a certain range of data?

2 ビュー (過去 30 日間)
Georgios Pasias
Georgios Pasias 2019 年 5 月 6 日
回答済み: Bob Thompson 2019 年 5 月 6 日
I am trying to construct a graph using 2 scripts. One of the scripts gives the datapoints for 0<x<x', while the other script gives the datapoints for x>x'.
Any ideas on how to do that?
Edit: The two sets of data overlap, so I would like to define the range of x-values that should be taken from each dataset.
  3 件のコメント
Raj
Raj 2019 年 5 月 6 日
Can you share some more details? From the information you have given, I don't see any issue here. You can always concatenate the data obtained from the two scripts and plot it.
Georgios Pasias
Georgios Pasias 2019 年 5 月 6 日
I apologise for the confusion. I cannot 'hold on' because the two sets of data overlap, so I would like to define the range of x-values that should be taken from each dataset.

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

回答 (1 件)

Bob Thompson
Bob Thompson 2019 年 5 月 6 日
You said you have two scripts. How are you running your two scripts? Are you running them separately, or are you running them in a wrapper. Either way, the difference is really only in where the execution happens, rather than the actual code. I am going to assume that A is the first set of data (x and y), and B is the second set of data.
C = A(A(:,1) < x',:);
C = [C; B(B(:,1) >= x',:)];
plot(C(:,1),C(:,2));

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by