build a origin destination matrix from 3 vectors without using vec2mat funct
Show older comments
hello everyone, i would know how i can build a origin-destination matrix from 3 vectors: first one is the origin label vector, second the destination label vector and the third one is the distances vector.
A= [[0 0 0;0 1 7;0 2 6;0 3 2;0 4 1;1 0 4;1 1 0;1 2 2;1 3 3;1 4 7;2 0 10;2 1 2;2 2 0;2 3 4;2 4 3;3 0 12;3 1 14;3 2 3;3 3 0;3 4 2;4 0 7;4 1 9;4 2 2;4 3 1;4 4 0]]
for each origin to all destination i have to obtain the corresponding distance value
matrix_dist= [0 7 6 2 1;
4 0 2 3 7;
10 2 0 4 3;
12 14 3 0 2;
7 9 2 1 0]
vec2mat function cannot be used
2 Comments
Accepted Answer
More Answers (0)
Categories
Find more on Communications Toolbox 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!