MCQs on Optimization and Curve Fitting | MATLAB

Optimization and curve fitting are essential techniques in data analysis, enabling precise mathematical modeling and optimization of real-world problems. Master topics like fminsearch, fmincon, polynomial fitting, interpolation, and smoothing.

MCQs

1. Introduction to Optimization (fminsearch, fmincon)

  1. Which MATLAB function is used to find the minimum of an unconstrained multivariable function?
    a) fminsearch
    b) fmincon
    c) linprog
    d) quadprog
  2. What does the fmincon function in MATLAB handle that fminsearch does not?
    a) Polynomial fitting
    b) Nonlinear constraints
    c) Symbolic computations
    d) Matrix inversion
  3. In optimization problems, what is the “objective function”?
    a) The function to minimize or maximize
    b) The gradient of the solution
    c) The constraint applied
    d) The feasible region
  4. Which of the following options is a valid constraint type in fmincon?
    a) Inequality constraints
    b) Equality constraints
    c) Both a and b
    d) Neither a nor b
  5. When using fminsearch, the objective function must:
    a) Return a scalar value
    b) Be linear
    c) Contain constraints
    d) Be a matrix
  6. What algorithm does fminsearch primarily use?
    a) Newton’s Method
    b) Nelder-Mead Simplex
    c) Gradient Descent
    d) Simulated Annealing
  7. Which parameter is adjusted to control the accuracy of the solution in fmincon?
    a) ConstraintTolerance
    b) ObjectiveFunctionTolerance
    c) MaxFunctionEvaluations
    d) StepTolerance
  8. Which output from fmincon provides information about convergence?
    a) Objective function value
    b) Gradient
    c) Exit flag
    d) Optimization variable

2. Polynomial Fitting (polyfit, polyval)

  1. What does the polyfit function return?
    a) Coefficients of the polynomial fit
    b) Fitted data points
    c) Derivative of the polynomial
    d) Interpolated values
  2. The polyval function is used for:
    a) Calculating polynomial coefficients
    b) Evaluating a polynomial at specific points
    c) Smoothing noisy data
    d) Finding roots of a polynomial
  3. To fit a quadratic polynomial using polyfit, the degree parameter should be set to:
    a) 1
    b) 2
    c) 3
    d) 4
  4. Which input argument does polyfit require apart from the data?
    a) Objective function
    b) Degree of the polynomial
    c) Constraints
    d) Interpolation points
  5. A larger degree in polyfit can lead to:
    a) Underfitting
    b) Overfitting
    c) Improved accuracy
    d) Reduced execution time
  6. What happens if there are fewer data points than the polynomial degree in polyfit?
    a) The fit fails
    b) Overfitting occurs
    c) Interpolation happens
    d) The degree is adjusted automatically
  7. If p is a polynomial coefficient vector, what does polyval(p, x) do?
    a) Computes polynomial roots
    b) Evaluates the polynomial at x
    c) Finds the derivative
    d) Fits data points

3. Curve Fitting Toolbox

  1. The Curve Fitting Toolbox primarily supports:
    a) Interpolation only
    b) Parametric and non-parametric fitting
    c) Symbolic calculations
    d) Linear optimization
  2. Which GUI in MATLAB allows interactive curve fitting?
    a) Simulink
    b) cftool
    c) sfit
    d) appdesigner
  3. Which of the following fitting options is NOT available in the Curve Fitting Toolbox?
    a) Polynomial fitting
    b) Fourier fitting
    c) Linear regression
    d) Genetic algorithm fitting
  4. The “goodness of fit” is measured using:
    a) Residuals
    b) R-squared
    c) Both a and b
    d) None of the above
  5. Which method is used to smooth noisy data in the Curve Fitting Toolbox?
    a) Lowess
    b) Spline
    c) Polynomial regression
    d) All of the above
  6. Which statement is true about non-linear fitting in the Curve Fitting Toolbox?
    a) It requires initial parameter guesses
    b) It only fits polynomials
    c) It is faster than linear fitting
    d) It cannot handle noisy data

4. Data Interpolation and Smoothing

  1. Which MATLAB function is used for 1-D interpolation?
    a) interp1
    b) spline
    c) polyval
    d) curvefit
  2. What type of interpolation is provided by the interp1 function when using the ‘linear’ method?
    a) Smoothing
    b) Straight-line interpolation
    c) Polynomial interpolation
    d) Nearest-neighbor interpolation
  3. Which function is suitable for cubic spline interpolation?
    a) interp1
    b) spline
    c) polyfit
    d) polyval
  4. What is the primary advantage of spline interpolation?
    a) High computational speed
    b) Produces smooth curves
    c) Requires fewer data points
    d) Guarantees exact fit
  5. Data smoothing techniques are used to:
    a) Interpolate missing values
    b) Reduce noise in data
    c) Increase data resolution
    d) Extrapolate trends
  6. What does the smooth function in MATLAB primarily do?
    a) Fits polynomial models
    b) Removes high-frequency noise
    c) Computes derivatives
    d) Performs interpolation
  7. When applying the moving average method, the window size controls:
    a) Number of coefficients
    b) Degree of polynomial
    c) Amount of smoothing
    d) Speed of computation
  8. Which function applies a Savitzky-Golay filter for smoothing?
    a) sgolay
    b) smooth
    c) interp1
    d) curvefit
  9. What happens when the window size for smoothing is too large?
    a) Data becomes oversmoothed
    b) Noise increases
    c) Trend accuracy improves
    d) Computation time decreases

Answer Key

QnoAnswer (Option with the text)
1a) fminsearch
2b) Nonlinear constraints
3a) The function to minimize or maximize
4c) Both a and b
5a) Return a scalar value
6b) Nelder-Mead Simplex
7a) ConstraintTolerance
8c) Exit flag
9a) Coefficients of the polynomial fit
10b) Evaluating a polynomial at specific points
11b) 2
12b) Degree of the polynomial
13b) Overfitting
14b) Overfitting occurs
15b) Evaluates the polynomial at x
16b) Parametric and non-parametric fitting
17b) cftool
18d) Genetic algorithm fitting
19c) Both a and b
20d) All of the above
21a) It requires initial parameter guesses
22a) interp1
23b) Straight-line interpolation
24b) spline
25b) Produces smooth curves
26b) Reduce noise in data
27b) Removes high-frequency noise
28c) Amount of smoothing
29a) sgolay
30a) Data becomes oversmoothed

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top