【发布时间】:2017-05-23 05:01:41
【问题描述】:
我想在Matlab中在并发的水平线上画一条垂直线,并显示垂直线与水平线相交的坐标。我在这里给出一个图,我想写一个代码,让它先画一条线,然后自动显示交点坐标。
【问题讨论】:
-
请提及您目前所拥有的。水平线的方程?你想在哪里画垂直线?存在无数种解决方案。
标签: matlab image-processing matlab-coder
我想在Matlab中在并发的水平线上画一条垂直线,并显示垂直线与水平线相交的坐标。我在这里给出一个图,我想写一个代码,让它先画一条线,然后自动显示交点坐标。
【问题讨论】:
标签: matlab image-processing matlab-coder
L1 = [0.7290 0.2163
0.2026 0.9763] ; % line 1 coordinates
L2 = [0.5932 0.9677
0.3044 0.8960] ; % line 2 coordinates
figure(1)
hold on
plot(L1(1,:),L1(2,:),'r')
plot(L2(1,:),L2(2,:),'b')
%% Get intersection
P = InterX(L1,L2) ;
%
plot(P(1),P(2),'*r')
%% Show points
text(P(1),P(2),num2str(P)) ;
从链接下载函数InterX: https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections?focused=5165138&tab=function
【讨论】: