I am trying to use the union function in MATLAB to obtain the disjunction of two closed regions of the form [a,b] and [c,d].
For e.g.
a=[1 3];
b=[3 6];
c=union(a,b)
I am getting the answer as c = [1 3 6], whereas I want the answer to be only [1 6].
Is there some trick I can play with the union function to achieve
As per the suggestion by @bernhard, I can use setxor to achieve this.
But supposing my matrix looks like
a[1 2: 3 5: 2 4};
b=[2 4];
c=setxor(a,b,'rows')
gives the output as [1 2: 3 5].
But as before my answer should be of the form [1 5]. What do I need to do to get that?
It seems to me that what you are trying to achieve can be obtained by