Have you ever tried to find the common elements/rows to more than two sets without using a loop?
Now you can with multiple-input set functions: Intersectm, ismemberm, setdiffm, setxorm, unionm.
Brief syntax example:
These functions are substantially wrappers of ismember/ismemberm (like the original two-input ones with the exception of ismember).
For details see help.
For examples see the attached documentation.
Comments/suggestions/error reports are welcome.
Oleg Komarov (2021). Set functions with multiple inputs (https://www.mathworks.com/matlabcentral/fileexchange/28341-set-functions-with-multiple-inputs), MATLAB Central File Exchange. Retrieved .
I know this is a pretty old submission, but...The stated expected behavior of "setxorm", "returns values that are not in the intersection of A, B, C, ...", seems odd to me (although it is clear and seems to do what it says)...wouldn't you rather want it to return the values that are unique across A, B, C, etc.? So I would expect setxorm([1,2,3] , [2,3,4] , [3,4,5]) to return the values [1,5], not [1,2,4,5]. Of course, I guess xor is not really defined for non-binary decisions so perhaps both choices are valid and the issue is moot. In 2020, ismemberm seems to be broken because ismember now does not like to receive  as a flag. Anyway, thank you for the submission! It has been instructive to study.
really nice work. It's amazing. Hopefully it can be faster in the future.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!