Plotting a specific part of the array

15 ビュー (過去 30 日間)
Mateusz Brzezinski
Mateusz Brzezinski 2020 年 9 月 23 日
編集済み: KALYAN ACHARJYA 2020 年 9 月 23 日
I have a problem with plotting a specific part of the array. I have 3 arrays x(1,n), y1(1,n) and y2(1,n). Values in arrays y1 and y2 initially have the same value then they starting to differ to finally have the same value. A simple example is:
x1= 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14 , 15,
y1 = 4.5, 5, 5.5, 6, 7, 8, 9, 8, 7, 7, 6, 5.5, 5, 5, 4.5,
y2 = 4.5, 5, 5.5, 4, 3, 2, 1, 1, 2, 3, 4, 5.5, 5, 5, 4.5,
I would like to use the figure function but limit the input size to the only part where they differ so:
x1= 4, 5, 6, 7, 8, 9, 10, 11
y1 = 6, 7, 8, 9, 8, 7, 7, 6,
y2 = 4, 3, 2, 1, 1, 2, 3, 4,
I will apreciate any help or hint.

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 9 月 23 日
編集済み: KALYAN ACHARJYA 2020 年 9 月 23 日
idy1=y1(y1~=y2)
idy2=y2(y2~=y1)
Results:
idy1 =
6 7 8 9 8 7 7 6
idy2 =
4 3 2 1 1 2 3 4
Note: x1 having length 14, whereas y1 and y2 having length 15, Now x1 comparision with?

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by