Homework 7 Bob

# Homework 7 Bob - 28.1 > syms x > expand(x-2)^9 ans = x^9...

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

28.1) >> syms x >> expand((x-2)^9) ans = x^9 - 18*x^8 + 144*x^7 - 672*x^6 + 2016*x^5 - 4032*x^4 + 5376*x^3 - 4608*x^2 + 2304*x - 512 >> clear >> f1 = inline('(x-2).^9','x') f1 = Inline function: f1(x) = (x-2).^9 >> x=1.92:.001:2.08; >> y1=f1(x); >> plot(x,y1,'blue') >> f2 = inline('x.^9 - 18.*x.^8 + 144.*x.^7 - 672.*x.^6 + 2016.*x.^5 - 4032.*x.^4 + 5376.*x.^3 - 4608.*x.^2 + 2304.*x - 512','x') f2 = Inline function: f2(x) = x.^9 - 18.*x.^8 + 144.*x.^7 - 672.*x.^6 + 2016.*x.^5 - 4032.*x.^4 + 5376.*x.^3 - 4608.*x.^2 + 2304.*x - 512 >> y2=f2(x); >> hold on >> plot(x,y2,'red') In theory the graphs should be the same however in practice errors arise as the topic of the chapter implies. A comparison of the output for y1 and y2 can be found in the lists on the following pages. Y1 is in the left column and y2 is in the right. An examination of the two columns will indicate that y1 follows a smooth progression while y2 has fluctuations both positive and negative in respect to y1. Both methods of the calculation return 0 for f(2) >> f1(2) ans = 0 >> f2(2) ans = 0 Output of the two methods of calculations

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

View Full Document
>> y1 y1 = 1.0e-009 * Columns 1 through 7 -0.1342 -0.1199 -0.1069 -0.0952 -0.0846 -0.0751 -0.0665 Columns 8 through 14 -0.0589 -0.0520 -0.0458 -0.0404 -0.0355 -0.0311 -0.0272 Columns 15 through 21 -0.0238 -0.0207 -0.0180 -0.0156 -0.0135 -0.0117 -0.0101 Columns 22 through 28 -0.0087 -0.0074 -0.0064 -0.0054 -0.0046 -0.0039 -0.0033
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern