C(2,3) returns a 1x1 cell containing 6, not the number 6 itself.
Final Answer:
C(2,3) returns a cell, not the content inside the cell -> Option A
Quick Check:
Use curly braces to get content: C{2,3} [OK]
Hint: Use curly braces { } to get cell content, parentheses () return cells [OK]
Common Mistakes:
Using parentheses expecting content instead of cell
Confusing cell array indexing with numeric array indexing
Expecting direct numeric output from parentheses indexing
5. You want to create a cell array that stores a numeric vector, a string, and another cell array inside it. Which of the following correctly creates such a nested cell array?
hard
A. nestedCell = {[1, 2, 3], 'text', [true; false]};
B. nestedCell = {[1, 2, 3], 'text', [true, false]};
C. nestedCell = {[1, 2, 3], 'text', (true, false)};
D. nestedCell = {[1, 2, 3], 'text', {true, false}};
Solution
Step 1: Identify nested cell array syntax
To nest a cell array inside another, use curly braces { } inside the main cell array.
Step 2: Check each option for correct nesting
nestedCell = {[1, 2, 3], 'text', {true, false}}; uses {true, false} as a nested cell array inside the main cell array.