how to set matrix from data
1 view (last 30 days)
Show older comments
yu yue
on 15 Oct 2016
Commented: Walter Roberson
on 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 Comments
Accepted Answer
Walter Roberson
on 15 Oct 2016
sn = 6; en = 2;
m = zeros(1, max(sn,en));
m(sn) = -1;
m(en) = 1;
2 Comments
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!