Question

Given the data set with t values in the first column and y values in the...

Given the data set with t values in the first column and y values in the second column, write a script file that:

-Curve fits the given data set with an appropriate polynomial function

-Outputs the R2 value of the appropriate fit along with the values of the polynomial order higher and lower (ex. If you choose a 2nd order fit, display the R2 value for first, second, and third order fits.)

- Estimate the value of the data at t = 15.5 using a 3 point interpolation.

Copy and paste the below values in excel and use that to pull data into your Matlab script file.

If you need any additional information then comment, thanks!

0

3

0.5

1.68569428820791

1

-3.95784854932628

1.5

-2.70275004645052

2

-8.20804222177874

2.5

-9.7888937947024

3

-10.8794243196858

3.5

-16.6350020109363

4

-15.3341094985447

4.5

-20.575599024921

5

-22.2647035001955

5.5

-22.9502699366898

6

-28.6160632481857

6.5

-27.0985091529083

7

-31.8763653389923

7.5

-33.4893475992729

8

-33.5897736790413

8.5

-38.9634230062392

9

-37.0581929509318

9.5

-41.1733606982684

10

-42.5247497074079

10.5

-41.8608395460318

11

-46.7395103467172

11.5

-44.2753705569831

12

-47.5296212422044

12.5

-48.4328411108291

13

-46.8263426410198

13.5

-51.0067929600693

14

-47.8122186368842

14.5

-50.0081973545762

15

-50.2755632708189

15.5

-47.5491275196853

16

-50.8277773078467

16.5

-46.7308822816937

17

-47.6721512398972

17.5

-47.1148702832052

18

-43.0920066727989

18.5

-45.2650085942502

19

-40.0934765705277

19.5

-39.5845544477838

Homework Answers

Answer #1

clear
clc
A=xlsread('Exam2_Data.xlsx');
t=A(:,1);
y=A(:,2);
SST=sum((y-mean(y)).^2);
for i=1:3
fprintf('For %d order fit\n\n',i);
disp('Polynomial coefficients are');
C=polyfit(t,y,i)
SSR=sum((y-polyval(C,t)).^2);
R2=1-SSR/SST;
fprintf('R^2 is %f\n\n',R2);
end
for i=2:length(t)-1
T=[t(i-1) t(i) t(i+1)];
Y=[y(i-1) y(i) y(i+1)];
  
if(t(i)<15.5&t(i+1)>15.5)
C=polyfit(T,Y,2);
disp('Value at 15.5 is ');
polyval(C,15.5)
return
end
end

Kindly revert for any queries

Thanks.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Calculate the Y values corresponding to the X values given below. Find the critical values for...
Calculate the Y values corresponding to the X values given below. Find the critical values for X for the given polynomial by finding the X values among those given where the first derivative, dy/dx = 0 and/or X values where the second derivative, d­2y/dx2 = 0. Be sure to indicate the sign (+ or -) of dy/dx and of d2y/dx2 tabled values. Reference Power Point Lesson 13 as needed. Using the first and second derivative tests with the information you...
Data sets for the 2 questions below Data Set G: Assume the population values are normally...
Data sets for the 2 questions below Data Set G: Assume the population values are normally distributed. Random variable: x = weight of border collie in pounds sample size = 25 34.1 40.8 36.0 34.9 35.6 43.4 35.4 29.3 33.3 37.8 35.8 37.4 39.0 38.6 33.9 36.5 37.2 37.6 37.3 37.7 34.9 33.2 36.2 33.5 36.9 Use Excel (or similar software) to create the tables. Then copy the items and paste them into a Word document. The tables should be...
Calculate the Y values corresponding to the X values given below. Find the critical values for...
Calculate the Y values corresponding to the X values given below. Find the critical values for X for the given polynomial by finding the X values among those given where the first derivative, dy/dx = 0 and/or X values where the second derivative, d­2y/dx2 = 0.    Be sure to find the sign (+ or -) of dy/dx and of d2y/dx2 at all X values. Reference Lesson 13 and the text Appendix A (pp 694 – 698), as needed. Using the...
Calculate the Y values corresponding to the X values given below. Find the critical values for...
Calculate the Y values corresponding to the X values given below. Find the critical values for X for the given polynomial by finding the X values among those given where the first derivative, dy/dx = 0 and/or X values where the second derivative, d­2y/dx2 = 0.    Be sure to find the sign (+ or -) of dy/dx and of d2y/dx2 at all X values. Reference Lesson 13 and the text Appendix A (pp 694 – 698), as needed. Using the...
Data sets for the question below Data Set G: Assume the population values are normally distributed....
Data sets for the question below Data Set G: Assume the population values are normally distributed. Random variable: x = weight of border collie in pounds sample size = 25 34.1 40.8 36.0 34.9 35.6 43.4 35.4 29.3 33.3 37.8 35.8 37.4 39.0 38.6 33.9 36.5 37.2 37.6 37.3 37.7 34.9 33.2 36.2 33.5 36.9 Use Excel (or similar software) to create the tables. Then copy the items and paste them into a Word document. The tables should be formatted...
Problem #3 1) Conduct a related-sample t-test using the following data set. Each row represents a...
Problem #3 1) Conduct a related-sample t-test using the following data set. Each row represents a pair of scores. A: 18, 35, 31, 30, 40, 25, 11, 30, 28, 20 B: 4, 40, 13, 18, 30, 27, 17, 18, 12, 20 - 2) Determine the critical values (for an alpha of .05) that you should use to evaluate this t-score. - 3) Compute r2 for this t-test.
How can I reduce data set by deleting any rows that have all FALSE values for...
How can I reduce data set by deleting any rows that have all FALSE values for every column in that row using pandas. Example: The table data below the pandas code should drop/reduce the data to remove the second & fifth row. Treat The Dtype for the True and False values as object. id Test1 value1 value2 value3 value4 0.1 1 False False False False 0.2 2 False True True False 0.3 3 True False False False 0.4 4 False...
The Student's t distribution table gives critical values for the Student's t distribution. Use an appropriate...
The Student's t distribution table gives critical values for the Student's t distribution. Use an appropriate d.f. as the row header. For a right-tailed test, the column header is the value of α found in the one-tail area row. For a left-tailed test, the column header is the value of α found in the one-tail area row, but you must change the sign of the critical value t to −t. For a two-tailed test, the column header is the value...
The Student's t distribution table gives critical values for the Student's t distribution. Use an appropriate...
The Student's t distribution table gives critical values for the Student's t distribution. Use an appropriate d.f. as the row header. For a right-tailed test, the column header is the value of α found in the one-tail area row. For a left-tailed test, the column header is the value of α found in the one-tail area row, but you must change the sign of the critical value t to −t. For a two-tailed test, the column header is the value...
The NaOH used in this lab should have been 0.1M, since you were to make it...
The NaOH used in this lab should have been 0.1M, since you were to make it as such (see Step 15 in lab document). Compare your standardized average molarity of NaOH in this lab to 0.1M. How do the values compare? How close was your NaOH dilution to actually being 0.1M NaOH? Calculate your percent error against the average standardized value from this lab. (You must show all work to receive credit.) step 15- Prepare an aliquot (fancy chemical term...