Question

LA Variables - TempPress 1 TempPress X # 34x16 table 10 13 16 VarName4 VarName7 VarName8 11 VarName11 12 VarName 12 VarName 14. Write a MATLAB script that will read the data from the second tab of the Excel file HW8_Data_Sheet. Then calculate and plo

0 0
Add a comment Improve this question Transcribed image text
Answer #1

%if any error occurs, please tell in comments

%a
data=xlsread('HW8_Data_Sheet.xlsx',2);
pressureATM=data(:,1);
temperatureK=data(:,2);

%b
coefficients=polyfit(pressureATM,temperatureK,1);

%c
yfit=polyval(coefficients,pressureATM);

%d
plot(pressureATM,temperatureK,'ro',pressureATM,temperatureK,'b')
xlabel('pressure (ATM)')
ylabel('temperature (K)')
title('Temperature vs Pressure')

%e
ybar= mean(temperatureK(:));

%f
rSqr = (1-sum((temperatureK(:)-yfit(:)).^2))./(sum(temperatureK-ybar).^2);
fprintf('rSqr: %f\n',rSqr)

Add a comment
Know the answer?
Add Answer to:
LA Variables - TempPress 1 TempPress X # 34x16 table 10 13 16 VarName4 VarName7 VarName8...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A wind tunnel test conducted on an airfoil section yielded the following data between the lift...

    A wind tunnel test conducted on an airfoil section yielded the following data between the lift coefficient (CL) and the angle of attack (?): 12 1.40 16 1.71 20 1.38 de CL 0.11 0.55 0.95 You are required to develop a suitable polynomial relationship between ? and CL and fit a curve to the data points by the least-squares method using (a) hand calculations and (b) Matlab programming Hint: A quadratic equation (parabola) y(x)-aa,x +a x' can be used in...

  • Homework 5 (35 Points max) Please Submit all Matlab and Data files that you create for this homew...

    Homework 5 (35 Points max) Please Submit all Matlab and Data files that you create for this homework Problem 1 (max 20 Points): For the second-order drag model (see Eq.(1)), compute the velocity of a free-falling parachutist using Euler's method for the case where m80 kg and cd 0.25 kg/m. Perform the calculation from t 0 to 20 s with a step size of 1ms. Use an initial condition that the parachutist has an upward velocity of 20 m/s at...

  • Be able to give traversals of the entire tree: Pre-Order: 45, 25, 15, 10, 20, 35,...

    Be able to give traversals of the entire tree: Pre-Order: 45, 25, 15, 10, 20, 35, 30, 40, 65, 55, 50, 60, 75, 70, 80 (extra 45 removed). In-Order: 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80 Post-Order: 10, 20, 15, 30, 40, 35, 25, 50, 60, 55, 70, 80, 75, 65, 45

  • The following table shows the number of males in a country in 2000, broken down by...

    The following table shows the number of males in a country in 2000, broken down by age. Numbers are in millions. Age 0–18 18–25 25–35 35–45 45–55 55–65 65–75 75 and over Number 36.9 15.5 21.4 22.4 18.1 12.3 8.1 6.1 Construct the associated probability distribution (with probabilities rounded to four decimal places). Age 0–18 18–25 25–35 35–45 45–55 55–65 65–75 75 and over Probability Use the distribution to compute the following. (Round your answers to four decimal places.) (a)  P(25...

  • the following questions based on the titration curve below the following question 15 T 12 13...

    the following questions based on the titration curve below the following question 15 T 12 13 12 12 -04 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 volume of Na0H (1) (2pt) Read the second equivalence points from the plot? (2) (2pt) What is the pKaz of this acid? (2pt) Determine the

  • A capacitor is charged to an initial voltage Vo - 7.6 V. The capacitor is then...

    A capacitor is charged to an initial voltage Vo - 7.6 V. The capacitor is then discharged by connecting its terminals through a resistor. The currentI (t) through this resistor, determined by measuring the voltage VR(t)- I(t)R with an oscilloscope, is shown in the graph. 85 80 75 70 65 60 50 45 40 35 30 25 20 15 10 ms) 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 Part...

  • 8. Following are the 'Handic spectra for two isomeric hromalkancs, A and B (compon following page) with molecular...

    8. Following are the 'Handic spectra for two isomeric hromalkancs, A and B (compon following page) with molecular formula C.H.Br. Draw their structure. (compound B is on the 1Η COCI (Solvent) www wwwwwwwwwwwwww 95 90 85 80 75 70 wwww 60 55 50 45 65 40 35 30 25 20 15 10 CDCI (Solvent) TMS 95 90 RS 80 75 70 65 60 55 50 45 40 35 30 25 20 15 10 5 0 -5 -10

  • Use MATLAB to answer this question. Include MATLAB code used in answer. 1. Measurements of the...

    Use MATLAB to answer this question. Include MATLAB code used in answer. 1. Measurements of the fuel efficiency of a car FE at various speeds v are shown in the table v (m 35 29.5 15 25 28 65 27 75 23 E (m 30 30 a) Curve-fit the data with the second-order polynomial. Use the polynomial to estimate the fuel efficiency at 60 mi/h. make a plot of the points and polynomial. b) Curve-fit the data with the third-order...

  • 100- Relative Intensity T 10 15 20 25 30 35 50 55 60 65 70 75...

    100- Relative Intensity T 10 15 20 25 30 35 50 55 60 65 70 75 40 45 m/z

  • The clearness index was determined for the skies over Baghdad for each of the 365 days...

    The clearness index was determined for the skies over Baghdad for each of the 365 days during a particular year (Contribution to the Study of the Solar Radiation Climate of the Baghdad Environment, Solar Energy, 1990: 7–12). The accompanying table gives the results. Class Frequency .15 - 25 8 .25 - 35 14 .35 - .45 28 .45 - .50 24 .50 -.55 .55 - .60 51 .60 - .65 106 .65 -.70 84 .70 - 75 11 (a). Draw...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT