Bird
0
0

What does the MATLAB function strfind return when the substring is not found in the string?

easy📝 Conceptual Q2 of 15
MATLAB - String Handling
What does the MATLAB function strfind return when the substring is not found in the string?
ANaN
BLogical false
CError message
DAn empty array []
Step-by-Step Solution
Solution:
  1. Step 1: Recall strfind behavior

    strfind returns indices where substring starts or empty if not found.
  2. Step 2: Check what happens if substring missing

    It returns an empty array, not logical or error.
  3. Final Answer:

    An empty array [] -> Option D
  4. Quick Check:

    Substring missing = empty array [] [OK]
Quick Trick: strfind returns [] if substring not found [OK]
Common Mistakes:
  • Expecting logical false
  • Thinking it throws error
  • Confusing with contains output

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More MATLAB Quizzes