Bird
0
0

What will the following MATLAB code display?

medium📝 Predict Output Q13 of 15
MATLAB - 2D Plotting
What will the following MATLAB code display?
x = 1:5;
y = [2 4 6 8 10];
scatter(x, y, 100, 'r', 'filled')
AA scatter plot with red filled circles sized 100 at points (1,2), (2,4), ..., (5,10)
BA line plot connecting points from (1,2) to (5,10)
CAn error because 'filled' is not a valid option
DA scatter plot with default size and blue color points
Step-by-Step Solution
Solution:
  1. Step 1: Understand scatter parameters

    The code uses scatter(x, y, 100, 'r', 'filled') which sets point size to 100, color red ('r'), and fills the markers.
  2. Step 2: Interpret the plot output

    The plot shows red filled circles at points (1,2), (2,4), (3,6), (4,8), and (5,10).
  3. Final Answer:

    A scatter plot with red filled circles sized 100 at points (1,2), (2,4), ..., (5,10) -> Option A
  4. Quick Check:

    scatter(x,y,100,'r','filled') = red filled circles [OK]
Quick Trick: Size, color, and fill control marker appearance [OK]
Common Mistakes:
  • Thinking 'filled' causes error
  • Confusing scatter with line plot
  • Ignoring size and color parameters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More MATLAB Quizzes