>> x = [10 15 20 20 25 25 23 30]';
>> y = [160 171 182 181 188 193 190 200]';
>> xyfit = fit(x,y,'poly1')
xyfit =
Linear model Poly1:
xyfit(x) = p1*x + p2
Coefficients (with 95pct confidence bounds):
p1 = 2.011 (1.711, 2.311)
p2 = 140.9 (134.4, 147.4)
>> a = xyfit.p1
a =
2.0109
>> knobSetting = [0 1 2 3 4 5]';
>> flowRate = [0.0 2.3 4.2 7.2 8.4 11.9]';
flowfit = fit(knobSetting,flowRate,'poly1')
slope = flowfit.p1
intercept = flowfit.p2
plot(flowfit, knobSetting, flowRate)
ppfit = fit(age, pressure,'poly2')
allCoeff = coeffvalues(ppfit)
plot(ppfit, age, pressure)
>> x = [0 1 2 3 4 5]';
>> y = [0.0 2.3 4.2 7.2 8.4 11.9]';
>> datafit = fit(x,y,'poly1')
datafit =
Linear model Poly1:
datafit(x) = p1*x + p2
Coefficients (with 95pct confidence bounds):
p1 = 2.309 (1.976, 2.642)
p2 = -0.1048 (-1.113, 0.9035)
>> plot(datafit,x,y,'residuals')
>> [datafit,gof] = fit(x,y,'poly1');
>> r2 = gof.rsquare
r2 =
0.9893
[fQuad gQuad] = fit(time, height, 'poly2')
r2Quad = gQuad.rsquare
plot(fQuad, time, height)
plot(fQuad, time, height, 'residuals')
[fCubic gCubic] =
>> x = [10 15 20 20 25 25 23 30]';
>> y = [160 171 182 181 188 193 190 200]';
>> xyfit = fit(x,y,'poly1')
xyfit =
Linear model Poly1:
xyfit(x) = p1*x + p2
Coefficients (with 95pct confidence bounds):
p1 = 2.011 (1.711, 2.311)
p2 = 140.9 (134.4, 147.4)
>> a = xyfit.p1
a =
2.0109
>> knobSetting = [0 1 2 3 4 5]';
>> flowRate = [0.0 2.3 4.2 7.2 8.4 11.9]';
flowfit = fit(knobSetting,flowRate,'poly1')
slope = flowfit.p1
intercept = flowfit.p2
plot(flowfit, knobSetting, flowRate)
ppfit = fit(age, pressure,'poly2')
allCoeff = coeffvalues(ppfit)
plot(ppfit, age, pressure)
>> x = [0 1 2 3 4 5]';
>> y = [0.0 2.3 4.2 7.2 8.4 11.9]';
>> datafit = fit(x,y,'poly1')
datafit =
Linear model Poly1:
datafit(x) = p1*x + p2
Coefficients (with 95pct confidence bounds):
p1 = 2.309 (1.976, 2.642)
p2 = -0.1048 (-1.113, 0.9035)
>> plot(datafit,x,y,'residuals')
>> [datafit,gof] = fit(x,y,'poly1');
>> r2 = gof.rsquare
r2 =
0.9893
[fQuad gQuad] = fit(time, height, 'poly2')
r2Quad = gQuad.rsquare
plot(fQuad, time, height)
plot(fQuad, time, height, 'residuals')
[fCubic gCubic] =
>> x = [10 15 20 20 25 25 23 30]';
>> y = [160 171 182 181 188 193 190 200]';
>> xyfit = fit(x,y,'poly1')
xyfit =
Linear model Poly1:
xyfit(x) = p1*x + p2
Coefficients (with 95pct confidence bounds):
p1 = 2.011 (1.711, 2.311)
p2 = 140.9 (134.4, 147.4)
>> a = xyfit.p1
a =
2.0109
>> knobSetting = [0 1 2 3 4 5]';
>> flowRate = [0.0 2.3 4.2 7.2 8.4 11.9]';
flowfit = fit(knobSetting,flowRate,'poly1')
slope = flowfit.p1
intercept = flowfit.p2
plot(flowfit, knobSetting, flowRate)
ppfit = fit(age, pressure,'poly2')
allCoeff = coeffvalues(ppfit)
plot(ppfit, age, pressure)
>> x = [0 1 2 3 4 5]';
>> y = [0.0 2.3 4.2 7.2 8.4 11.9]';
>> datafit = fit(x,y,'poly1')
datafit =
Linear model Poly1:
datafit(x) = p1*x + p2
Coefficients (with 95pct confidence bounds):
p1 = 2.309 (1.976, 2.642)
p2 = -0.1048 (-1.113, 0.9035)
>> plot(datafit,x,y,'residuals')
>> [datafit,gof] = fit(x,y,'poly1');
>> r2 = gof.rsquare
r2 =
0.9893