how to connect nearest neighbor node between source node to destination node
조회 수: 1 (최근 30일)
이전 댓글 표시
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150386/image.jpeg)
N=20;
area=100;
XX=area/2;
YY=area/2;
bs=[XX,YY];
X=rand(1,N)*area;
Y=rand(1,N)*area;
plot(XX,YY,':o','LineWidth',3,'MarkerEdgeColor','k','MarkerFaceColor',[0.5,0.5,0.5],'MarkerSize',15);
text(XX,YY,'BS');
hold on;
xlabel('X');
ylabel('Y');
X1=([X;Y])';
grid on;
for i=1:N
plot(X(i),Y(i));
text(X(i),Y(i),num2str(i),'fontsize',15);
end
now i wish to connect node 14 to 9 through nearest neighbor nodes
node 14 is source node connect with nearest node in direction destination node(9)
firstly 14 connect with 10
then 10 connect with 11
then 11 connect with BS
then BS connect with node 9
댓글 수: 0
채택된 답변
Walter Roberson
2015년 5월 21일
댓글 수: 3
Walter Roberson
2015년 5월 21일
singh please buy me a license for the Bioinformatics Toolbox so I can run that routine. My license is the Commercial / Professional license, so the price is only $US1000 for the toolbox. As my software maintenance has expired, it might be necessary to also buy a year of software maintenance at about $US325 as Mathworks will only allow toolboxes to be added to licenses that are at most one year (two years?) out of service. For sure the price will not exceed $US1500 so that I can run this code for you.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!