Borrar filtros
Borrar filtros

Find intersectional points of two discrete functions?

3 visualizaciones (últimos 30 días)
Tuoi
Tuoi el 9 de Ag. de 2013
I have two line graphs (Y=Y(X) and Z=Z(X)) with n discrete points of three arrays: X=[X1 X2 ... Xn], Y=[Y1 Y2 ... Yn] and Z=[Z1 Z2 ... Zn]
I plot two graphs by command: plot(X, Y, X, Z);
Now I want to get all of intersectional points of these two graphs. What command in Matlab can I use to do this? Please help me. Thanks.
  1 comentario
Jan
Jan el 9 de Ag. de 2013
The description is not clear yet. Please add an example by editing the question (not by posting a pseudo-answer or by hiding information in a comment):
What is the desired output for X=1:3, Y=[0, 3, 2], Z=[1,2,2]?

Iniciar sesión para comentar.

Respuestas (1)

David Sanchez
David Sanchez el 9 de Ag. de 2013
C = intersect(A,B)
returns the values common to both A and B. The values of C are in sorted order.
  1 comentario
Tuoi
Tuoi el 9 de Ag. de 2013
No, Y and Z can not have similar elements, normally I interpolate them to get intersectional points. My problem is that I find a command of Matlab to do this easily, in Matlab can I find it? Thanks. Not "intersect" command.

Iniciar sesión para comentar.

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by