How can i make plot with different length vector?

21 ビュー (過去 30 日間)
Alvin Alvin
Alvin Alvin 2019 年 12 月 16 日
回答済み: ME 2019 年 12 月 16 日
hello please help me, i have matrix A = 195x1 and A1 = 17675x1, how can i make plot with these?
  2 件のコメント
Luna
Luna 2019 年 12 月 16 日
Can you explain it more specific? what do those arrays represent? What kind of plot do you want to see? (scatter plot, X-Y plot, histogram, etc.)
Alvin Alvin
Alvin Alvin 2019 年 12 月 16 日
X-Y Plot

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

回答 (2 件)

KSSV
KSSV 2019 年 12 月 16 日
To plot, you are supposed to have dimensions of X and Y equal. Read about interp1. You can do inteprolation and get both the arrays to same dimension.
  2 件のコメント
Alvin Alvin
Alvin Alvin 2019 年 12 月 16 日
can you give me example with my case A = 195 x1 and A2 = 17675x1?. Will help me a lot
KSSV
KSSV 2019 年 12 月 16 日
You need to tell us more about the data.

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


ME
ME 2019 年 12 月 16 日
My guess here is that your two arrays (A and A1) represent your Y data. In that case you could simply create two different sized arrays containing the X data. For example, if the two data sets covered the same X range and assuming the points are equally spaced then you could do something like:
X = linspace(minX, maxX, 195);
X1 = linspace(minX, maxX, 17657);
plot(X,Y,X1,Y1)
If any of my assumptions about your data are incorrect then let us know and I'm sure me or somebody else can help.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by