How to find the elevation of a line?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a line whose x and y coordinates are known. the line is been drawn within the x_constraint = [0,60] and similarly y_constraints = [0,40]. I also have an elevation data in a separate file of size [60 X 40]. Now i want to combine both the files and know the elevation of the line at the simultaneous coordinate. Is there a possible way of achieving it?
Thanks in advance for your replies.
댓글 수: 1
Geoff Hayes
2015년 7월 4일
Sushma - how is the data formatted in the first file? Is it a 60x40 array too?
답변 (1개)
Image Analyst
2015년 7월 4일
Yes, you can simply use improfile() to extract the elevation along the line.
numSamples = round(sqrt(diff(xi).^2 + diff(yi).^2));
[cx, cy, elevations] = improfile(elevationImage, xi, yi, numSamples)
참고 항목
카테고리
Help Center 및 File Exchange에서 Axes Transformations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!