Bird
0
0

Which MATLAB function returns true only if two strings match exactly, including letter case?

easy📝 Conceptual Q1 of 15
MATLAB - String Handling
Which MATLAB function returns true only if two strings match exactly, including letter case?
Astrcmp
Bstrcmpi
Cstrncmp
Dcontains
Step-by-Step Solution
Solution:
  1. Step 1: Understand the functions

    strcmp compares two strings with case sensitivity, returning true only if they are exactly the same.
  2. Step 2: Compare with other functions

    strcmpi ignores case, strncmp compares only the first n characters, and contains checks substring presence.
  3. Final Answer:

    strcmp -> Option A
  4. Quick Check:

    Exact match with case sensitivity [OK]
Quick Trick: strcmp is case-sensitive string comparison [OK]
Common Mistakes:
  • Confusing strcmp with strcmpi which ignores case
  • Using contains which checks substrings, not equality

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More MATLAB Quizzes