Cross section of a plot (surface, Imagesc) using an arbitrary line
Mostrar comentarios más antiguos
I have a plot of surface(x,y,z) (or an imagesc) and want to draw an arbitrary line to get the z information following that path.
So I have two questions:
First, how to draw a path that coincides with my x,y grid? Let's say I want a semicircular path, but it can be whichever.

And second, how do I get the values that correspond to the Z information that follows that said path?
I am not sure if what I am asking is too complex to answer, but I would love to hear your comments,
Thanks in advance.
Respuesta aceptada
Más respuestas (3)
Image Analyst
el 9 de Mzo. de 2023
1 voto
That's exactly what my attached demo does. It allows you to draw over your image with drawfreehand and then plots the image values underneath where you drew:

Steven Lord
el 9 de Mzo. de 2023
0 votos
Others have spoken about the mathematics behind taking coordinate data of your math and generating the Z data. If you're having difficulty in the first part of the problem, generating the coordinate data, some options include using the ginput function to let you click points on the plot (for which I'd probably use a 2-D view of your surface, view(2), so you're clicking from "directly overhead") or using the improfile function from Image Processing Toolbox (if you're operating on image data or can treat your data as image data.)
Contoso Donoso
el 10 de Mzo. de 2023
0 votos
Categorías
Más información sobre Surface and Mesh Plots en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
