How to add weights in line
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
There already has a line between nodes. How can i add a weights in line to perform a shortest path?
if ~(length(list_biasa) == 1 && list_biasa == 0)
for k = list_biasa
if node(k).energy ~= 0 && node(list_sch).energy ~= 0
line ([node(list_sch).x, node(list_biasa).x], [node(list_sch).y, node(list_biasa).y],weights );
end
Result:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/196238/image.png)
To add weights as following:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/196240/image.png)
Thanks
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!