Plotting a straight line with different 'x' and 'y' lengths

4 visualizaciones (últimos 30 días)
Guillem Foreman
Guillem Foreman el 29 de Jun. de 2022
Comentada: Guillem Foreman el 29 de Jun. de 2022
Hi,
I've got an 'imagesc' plot and I would like to plot a line that goes through all the 'x' and 'y' values for a certain value of the 'z' component. To show it visually, I would like something like this:
where the black line goes through all the 'x' and 'y' values for a certain 'z' value (in this case, 'z' is around 40).
Thanks so much for your help in advance.
  4 comentarios
Adam Danz
Adam Danz el 29 de Jun. de 2022
Editada: Adam Danz el 29 de Jun. de 2022
Is the goal to fit a straight line to the (x,y) coordinates that lie under z=~35?
If so, find all z values within close proximity to whatever target value you're using and return the indicies. Then use those indicies to get the (x,y) values and fit the results to a line.
If you get stuck with this approach, show us what you've got and I'm sure we can help smooth things out.
Guillem Foreman
Guillem Foreman el 29 de Jun. de 2022
Alright, I finally managed to get it :) I had actually gotten the indices you were talking about, but for some reason I was trying to only use the first one to build the line. Thanks!

Iniciar sesión para comentar.

Respuestas (0)

Categorías

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

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by