ME218 HW 5,2

ME218 HW 5,2 - Greg Gangluff ME 218 HW 5 Tuesday 1-3 1.a) M...

This preview shows pages 1–3. Sign up to view the full content.

Greg Gangluff ME 218 HW 5 Tuesday 1-3 1.a) M flile called problem1.m clear all p = 1; x = [10, 20, 30]; y = [ 80 55 25]; H = length(x); q = 1; for i=1:p+1 for j=1:p+1 M(i,j) = sum(x.^((2*n)-(q-1))); q = q+1; end q = i+1; end N(i,j) = H; q = p+1; for i=1: p+1 L(i,1) = sum(y.*(x.^(k-1))); q = q-1; end solve = N\L mean = sum(y)/H; t = sum((y - mean).^2); r = sum((y - (solve(1,1)*x) - solve(2,1)).^2); s = ((t - r)/St)^.5 clear all >> problem1 solve = -2.7500 108.3333 s = 0.9986 1.b) (problem1b.m) clear all

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
p = 2; x = [10, 20, 30]; y = [ 80 55 25]; z = length(x); h = 1; for i=1:n+1 for j=1:n+1 M(i,j) = sum(x.^((2*p)-(h-1))); h = h+1; end h = i+1; end N(i,j) = z; h = p+1; for i=1: p+1 L(i,1) = sum(y.*(x.^(h-1))); h = h-1; end solve = N\L mean = sum(y)/z; t = sum((y - y_mean).^2); r = sum((y - (solve(1,1)*(x.^2)) - (solve(2,1)*x) - solve(3,1)).^2); s = ((t - r)/t)^.5 clear all >> problem1b solve = -0.0250 -1.7500 100.0000 s = 1 2a x1 (problem2a.m file) a = 1; x = [0:1:30]; y = [-11 -7 -3 -1 1 2 3 4 5 9 13 17 22 29 33 35 36 35 32 28 26 29 34 39 47 59 70 81 90 103 115]; Z = length(x);
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/23/2011 for the course ME 218 taught by Professor Unknown during the Fall '08 term at University of Texas at Austin.

Page1 / 6

ME218 HW 5,2 - Greg Gangluff ME 218 HW 5 Tuesday 1-3 1.a) M...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online