Extracting data tips from 3-D figure
조회 수: 1 (최근 30일)
이전 댓글 표시
Please download long_lati_depth.mat
And run the code.
May I ask how to automatically extract the data when the line A to B intersecting the isobath line which is one meter increment like [-74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84] ?
The extracted data should be a 3D matrix with selected longitude, latitude and depth.
I am trying to find the water depth change with range from A to B, with one meter increment. Thanks!
clear;clc;close all;figure(1);load('long_lati_depth.mat','long','lati','depth')
contour(long,lati,depth,[-74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84],'ShowText','on')
hold on
% A
plot3(-73.0497,39.0232,0,'ko','LineWidth',5);text(-73.0497,39.0232,'\leftarrow A','Color','red')
% B
plot3(-73.0623,39.0542,0,'ko','LineWidth',5);text(-73.0623,39.0542,'\leftarrow B','Color','red')
images.roi.Line(gca,'Position',[-73.0623 39.0542;-73.0497 39.0232]);
댓글 수: 0
채택된 답변
KSSV
2019년 7월 30일
clear;clc;close all;
figure(1);
load('long_lati_depth.mat','long','lati','depth')
contour(long,lati,depth,[-74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84],'ShowText','on')
hold on
% A
A = [-73.0497,39.0232] ;
plot3(-73.0497,39.0232,0,'ko','LineWidth',5);
text(-73.0497,39.0232,'\leftarrow A','Color','red')
% B
B = [-73.0623,39.0542] ;
plot3(-73.0623,39.0542,0,'ko','LineWidth',5);
text(-73.0623,39.0542,'\leftarrow B','Color','red')
% images.roi.Line(gca,'Position',[-73.0623 39.0542;-73.0497 39.0232]);
% Get line for AB
x = [A(1) B(1)] ;
y = [A(2) B(2)] ;
p = polyfit(x,y,1) ;
xi = linspace(x(1),x(2)) ;
yi = polyval(p,xi) ;
plot(xi,yi,'r')
% Get depth for xi,yi
zi = interp2(long,lati,depth,xi,yi) ;
iwant = [xi; yi ;zi]
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 National Instruments Frame Grabbers에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!