shortest path in 2D matrix between two coordinate points
Ältere Kommentare anzeigen
As in the attached image, i have a 2D matrix of 50 by 50. The matrix contains zeros (blue) and ones(yellow). Imagine it as a floor, The yellow or ones mean the walls. In this whole matrix a transmitter(T) and receiver (R) can be placed anywhere and i need to know how many walls the signal penetrates when it reaches from T to R. Lets suppose the T is at (x,y) and R is at (i,j). I take the shortest path between T and R. If i get the shortest path i can calculate the number of 1s in the path and that will be the number of walls which i need.
Can anyone help in this regard.. Thank you
Akzeptierte Antwort
Weitere Antworten (2)
Image Analyst
am 5 Jul. 2018
0 Stimmen
Use bwdistgeodesic().
See Steve's 5 part blog on shortest paths.
1 Kommentar
Sohaib Bin Altaf
am 7 Jul. 2018
Sohaib Bin Altaf
am 10 Jul. 2018
0 Stimmen
Kategorien
Mehr zu Dijkstra algorithm finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!