필터 지우기
필터 지우기

Plotting a specific part of the array

조회 수: 6 (최근 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 CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by