how to set matrix from data
1 vue (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
Catégories
En savoir plus sur Logical 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!