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
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...
Curve-Fit Function USING MATLAB Using the top-down design approach, develop a MATLAB function A8P2RAlastname.m that reads...
Curve-Fit Function USING MATLAB Using the top-down design approach, develop a MATLAB function A8P2RAlastname.m that reads data from a file and performs regression analysis using polyfit and polyval. The function shall have the following features: The input arguments shall include the file name (string), a vector of integers for the degrees of polynomial fits to be determined, and an optional plot type specifier (‘m’ for multiple plots, ‘s’ for a single plot - default). The data files will be text...
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.
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...
Consider the data set: L T 0.5 1.915684 0.7 1.29032 0.9 1.90683 1.1 1.840219 1.3 2.668192...
Consider the data set: L T 0.5 1.915684 0.7 1.29032 0.9 1.90683 1.1 1.840219 1.3 2.668192 1.5 2.432488 1.7 2.91615 1.9 2.731426 2.1 2.659927 2.3 2.662569 2.5 2.847514 2.7 3.754418 2.9 3.675227 3.1 3.363444 3.3 3.377861 3.5 4.080403 3.7 4.38519 3.9 4.073612 4.1 4.356581 4.3 4.27699 For this data we do not know how T depends on L. We hope that T is proportional to some power of L. Transform data by taking Logarithms and do linear regression. Upon computing...
Data For Tasks 1-8, consider the following data: 7.2, 1.2, 1.8, 2.8, 18, -1.9, -0.1, -1.5,...
Data For Tasks 1-8, consider the following data: 7.2, 1.2, 1.8, 2.8, 18, -1.9, -0.1, -1.5, 13.0, 3.2, -1.1, 7.0, 0.5, 3.9, 2.1, 4.1, 6.5 In Tasks 1-8 you are asked to conduct some computations regarding this data. The computation should be carried out manually. All the steps that go into the computation should be presented and explained. (You may use R in order to verify your computation, but not as a substitute for conducting the manual computations.) A Random...
Visit the NASDAQ historical prices weblink. First, set the date range to be for exactly 1...
Visit the NASDAQ historical prices weblink. First, set the date range to be for exactly 1 year ending on the Monday that this course started. For example, if the current term started on April 1, 2018, then use April 1, 2017 – March 31, 2018. (Do NOT use these dates. Use the dates that match up with the current term.) Do this by clicking on the blue dates after “Time Period”. Next, click the “Apply” button. Next, click the link...
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...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT