Explore BrainMass

# Numerical Methods : Matlab Program for Linear Least Squares Analylsis

Not what you're looking for? Search our solutions OR ask your own Custom question.

This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

Please see the attached file for the fully formatted problems.

https://brainmass.com/math/linear-programming/numerical-methods-matlab-program-for-linear-least-squares-analylsis-122196

#### Solution Preview

Examples of linear least square fit and quadratic least square fit are written and explained in comments in the attached Matlab script.
The two examples are also plotted in two figures.

======
function exampleLSQ()

% examples of linear and parabolic fits with randomly generated errors
% (noise)

np = 20 ; % number of points to use in the example
er = 4 ; % the amplitude of errors / noise

% randomly generated input for linear fit
intercept = 1 ; % assumed true intercept
slope = 2 ; ...

#### Solution Summary

A Matlab Program for Linear Least Squares Analylsis is provided. The solution is detailed and well presented. The response received a rating of "5/5" from the student who originally posted the question.

\$2.49