Say I have these vector:
head_1=[1 6];
body_1=[1 4 5 6 8 9 15];
head_2=[7 9 13];
body_2=[5 7 8 9 13 20 30];
head_3=[20 30];
body_3=[4 5 8 11 19 20 30 40 50 100];
A vector head is a subset of vector body. Now I would like to have a collection of all the head vectors, but if a vector head_x is fully in vector body_y, then take head_y instead. If vector head_x is partially in vector body_y, then take head_y instead plus the other elements of head_x. So in my example, the collection would be:
In reality I can have several head and body vectors. Any hint will be apprecaitted!
0 Comments
Sign in to comment.