How can I extract a line from a surface?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Leonardo Colavitti
el 17 de Feb. de 2017
Comentada: Leonardo Colavitti
el 21 de Feb. de 2017
Hello everybody, I would like to extract a line from a surface. I already represent quite easily with the commands plot3, mesh and surf my surface, that is divided in three parts because it represents three different domains. My initial input (in attachment the file InputValues.txt)is composed by a matrix (18011*3) of Longitude, Latitude and Depth values. I would like to build a function that in input takes the position of start (A) and end of my profile (B) (xa,ya,xb,yb) and in output return the position of the corresponding z in A and B {e.g. [A,B] = myfunc(xa,ya,xb,yb)}. Finally, I would like to plot the obtained curve after cutting my surface with a vertical plane. I have already achieved this result with another software (Global Mapping Tools, very used in geophysical applications), but now I'd like to obtain the same thing in Matlab environment, of which I am quite new. Someone is familiar with these kind of problems? Do you have any suggestions, please? Thanks in advance,
Leonardo
0 comentarios
Respuestas (1)
Sindhuja Parimalarangan
el 21 de Feb. de 2017
h = surf(x,y,z);
[xvalue,yvalue] = find((h.XData==xa) & (h.YData==ya));
You can model your function based on the above code.
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!