how to set matrix from data
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
yu yue
le 15 Oct 2016
Commenté : Walter Roberson
le 15 Oct 2016
I have a path from node 6 to node 2, how can i can get the matrix like this [0 1 0 0 0 -1] ?
0 commentaires
Réponse acceptée
Walter Roberson
le 15 Oct 2016
sn = 6; en = 2;
m = zeros(1, max(sn,en));
m(sn) = -1;
m(en) = 1;
2 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!