Add contents of two columns to new columns with a delimiter between them
1 view (last 30 days)
I have a matrix of 11693682x3 uint8. I would like to create so called 'keys' for my data in a new column. For example:
1, 2, 3
2, 5, 7
3, 3, 6,
4, 29, 0
1, 2, 3, 1|2
2, 5, 7, 2|5
3, 3, 6, 3|3
4, 29, 0, 4|29
Could anyone point me at the best way to solve this?
dpb on 24 May 2017
Well, it's simply impossible to add something like that as another column in an int8 array.
To do something similar you could create a corollary variable
I'd suggest more conventional hashing techniques might be more useful, though. What's the end use here?
Walter Roberson on 25 May 2017
If you only need to know what the distance is for each combination, but you do not need the path for each combination, then you can use https://www.mathworks.com/help/matlab/ref/graph.distances.html
If you need to know the path, then you can loop through all sources and use https://www.mathworks.com/help/matlab/ref/graph.shortestpath.html to all destinations.