Plotting a specific part of the array

7 visualizaciones (últimos 30 días)
Mateusz Brzezinski
Mateusz Brzezinski el 23 de Sept. de 2020
Editada: KALYAN ACHARJYA el 23 de Sept. de 2020
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.

Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 23 de Sept. de 2020
Editada: KALYAN ACHARJYA el 23 de Sept. de 2020
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?

Más respuestas (0)

Categorías

Más información sobre Graphics Objects en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by