Multiple choice general knowledge

The polyfit command, for example, polyfit(x,y,2) regresses y vs x data. What does the 2 stand for in the third argument of the polyfit example.

  1. First order polynomial

  2. Second order polynomial

  3. Two data points

  4. Interpolation

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The polyfit function fits a polynomial to data. The third argument specifies the degree of the polynomial: 1 for linear (first order), 2 for quadratic (second order), 3 for cubic, etc. Here, 2 means fitting a second-order (quadratic) polynomial. Options A and C are wrong because the argument specifies degree, not data points or order count. Option D is unrelated to polynomial fitting.