Bird
0
0

What will be the output of this MATLAB code?

medium📝 Predict Output Q5 of 15
MATLAB - String Handling
What will be the output of this MATLAB code?
str = 'MATLAB';
newStr = lower(str);
disp(newStr);
AError: Undefined function 'lower'
Bmatlab
CMatlab
DMATLAB
Step-by-Step Solution
Solution:
  1. Step 1: Understand the lower() function

    lower() converts all uppercase letters in a string to lowercase.
  2. Step 2: Apply lower() to 'MATLAB'

    All letters become lowercase, resulting in 'matlab'.
  3. Final Answer:

    matlab -> Option B
  4. Quick Check:

    lower() output = all lowercase string [OK]
Quick Trick: lower() converts strings to lowercase letters [OK]
Common Mistakes:
  • Expecting original case
  • Confusing lower() with upper()
  • Assuming function is undefined

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More MATLAB Quizzes