Question: Which statement creates a logical array that is 1 if the element in `passwords` contains a digit and 0 if it does not?

  1. contains(password, '\d')
  2. ~isempty(regexp(passwords, '\d'))
  3. cellfun(@(x) ~isempty(regexp(x, '\d')), passwords)
  4. regexp(passwords, '\d')

Answer: The correct answer of the above question is Option C:cellfun(@(x) ~isempty(regexp(x, '\d')), passwords)