Let m=[1,2,3,4,5,6,7,8,9,10]; be a set and let s=[ 2,4,5,6,8,9]; be a subset of m. How do list all missing numbers in s from m.
For example, the missing numbers in s from 1-->10 are 1,3,7,10. So, how can list them?
Thanks.
First of all, have a look at,
How to | Use Brackets and Braces Correctly
The Four Kinds of Bracketing in the Wolfram Language
and
Find which elements in the first list are not in any of the subsequent lists
m = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
s = {2, 4, 5, 6, 8, 9}
Complement[m, s]
{* {1, 3, 7, 10} *}
Complement
$\endgroup$Complement
doesn't seem to come up quickly when searching the documentation with keywords from the OP. Still, the documentation deserves a more thoughtful read,Complement
is quite a trivial function that comes up early on, learning the language. $\endgroup$