Bird
0
0

Given the code:

medium📝 Predict Output Q5 of 15
MATLAB - File I/O
Given the code:
data = xlsread('values.xlsx', 'B2:C4'); disp(data);

What does this code do?
AThrows an error due to invalid range
BReads the entire sheet named 'B2:C4' and displays it
CReads numeric data from cells B2 to C4 and displays it
DWrites data to cells B2 to C4
Step-by-Step Solution
Solution:
  1. Step 1: Understand xlsread with range

    xlsread reads numeric data from specified cell range.
  2. Step 2: Analyze the range 'B2:C4'

    This range selects cells from column B row 2 to column C row 4.
  3. Final Answer:

    Reads numeric data from cells B2 to C4 and displays it -> Option C
  4. Quick Check:

    xlsread with range reads numeric cells [OK]
Quick Trick: Specify cell range in xlsread to read part of sheet [OK]
Common Mistakes:
  • Thinking 'B2:C4' is a sheet name
  • Confusing reading with writing
  • Expecting error from valid range

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More MATLAB Quizzes