[go: up one dir, main page]

0% found this document useful (0 votes)
26 views1 page

Curve Fitting Quadratic Equation: Input Program & Result

The document discusses fitting a quadratic equation to a set of data points. It provides the input values, shows the MATLAB program and result, and compares the output to using the polyfit solver directly.

Uploaded by

YASH DOSHI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views1 page

Curve Fitting Quadratic Equation: Input Program & Result

The document discusses fitting a quadratic equation to a set of data points. It provides the input values, shows the MATLAB program and result, and compares the output to using the polyfit solver directly.

Uploaded by

YASH DOSHI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CURVE FITTING

QUADRATIC EQUATION
Table of Contents
INPUT .............................................................................................................................. 1
PROGRAM & RESULT ...................................................................................................... 1
OUTPUT ........................................................................................................................... 1
SOLVER ........................................................................................................................... 1

Name: Shubham Chapparghre Roll no. : 351013

INPUT
SC_QECF([0 1 2 3 4],[1 1.8 1.3 2.5 6.3])

PROGRAM & RESULT


function[]=SC_QECF(x,y)

n=length(x);
A=[sum(x.^4) sum(x.^3) sum(x.^2); sum(x.^3) sum(x.^2) sum(x);
sum(x.^2) sum(x) n];
B=[sum(y.*(x.^2));sum(x.*y); sum(y) ];
C=A\B;
fprintf('y=%f(x^2)+%f(x)+%f\n',C(1),C(2),C(3))

y=0.550000(x^2)+-1.070000(x)+1.420000

OUTPUT
y=0.550000(x^2)+-1.070000(x)+1.420000

SOLVER
polyfit([0 1 2 3 4],[1 1.8 1.3 2.5 6.3],2) ans = 0.5500 -1.0700 1.4200

Published with MATLAB® R2017a

You might also like