Question

In: Computer Science

So the problem is to create a plot of points and plot them using only 'o'...

So the problem is to create a plot of points and plot them using only 'o' and no lines then using the polyfit and polyval functions, find a first order equation to curve fit the points (and plot it on the existing plot).

I got that part and have the following code

clear
clc
%define measured data
temp = [250 300 340 400 460 500 540 600 660 700 750 810 930 1000 1120]
HC= [.791 .846 .895 .939 .978 1.014 1.046 1.075 1.102 1.126 1.148 1.169 1.204 1.234 1.328]
%calculate new HC values using polyfit and polyval
p=polyfit(temp,HC,1)
y1=polyval(p,temp)
%plot original data & 1st order curve
plot(temp,HC,'o')
hold on
plot(temp, y1)

The next part though is giving me trouble: Once you have found the slope and intercept, use those values to find the Heat capacity when the temperature is 800 and display the answer.

Solutions

Expert Solution

Executable code:

   clear

clc

%define measured data

temp = [250 300 340 400 460 500 540 600 660 700 750 810 930

1000 1120];

HC= [.791 .846 .895 .939 .978 1.014 1.046 1.075 1.102 1.126

1.148 1.169

1.204 1.234 1.328];

%calculate new HC values using polyfit and polyval

p=polyfit(temp,HC,1)

y1=polyval(p,temp);

%plot original data & 1st order curve

plot(temp,HC,'o')

hold on

plot(temp, y1)

%heat capacity when temperature is 800, where slope and

%intercept are 0.0006 and 0.7075 .it is in variable p

HC_800=(0.0006*800)+0.7075


Related Solutions

- Create a plot of the variable "fortw" (fortified wine sales). - Create a plot of...
- Create a plot of the variable "fortw" (fortified wine sales). - Create a plot of the ACF function for the same variable. - create a naive and exponential smoothing forecast for the variable "fortw". makw sure to take into account the attricutes that yous aw fromthe above plots. make sure to produce plots with the actual data and forecasts overlaid (one graph per forecasting technique) - Using the Mean Absolute Percentage Error (MAPE) measure of error, which of the...
MATLAB based problem: Create a motoring model for the engine with the following specifications, and plot...
MATLAB based problem: Create a motoring model for the engine with the following specifications, and plot the in-cylinder pressure against (i) cylinder volume and (ii) crank angle degrees (20 points)  Bore = 107mm, stroke = 124mm, compression ratio = 17.3, Length of connecting rod = 192mm. Assume the ratio of specific heats is 1.4 (constant), atmospheric pressure is 1 bar and ambient temperature is 298 K.
a. Create NAND gate using only transistors.
a. Create NAND gate using only transistors.b. Using the circuit block Create NAND gate using only transistors , attach additional components to the circuit to have the output of ANDgate.c. Explain both circuitsd. Out of CB, CC and CE which circuit will you use to amplify the sound output of your computer and why. Explain.
Using Python, generate 100 random numbers ranging from 1 to 5, then plot them using matplotlib...
Using Python, generate 100 random numbers ranging from 1 to 5, then plot them using matplotlib or Seaborn as a histogram
a. Graph and plot the 16 points (Use the blank graph on the next page of this test).
y x xy xx yy 11.4 0 0 0 129.96 11.9 1 11.9 1 141.61 7.1 2 14.2 4 50.41 14.2 3 42.6 9 201.64 5.9 4 23.6 16 34.81 6.1 5 30.5 25 37.21 5.4 6 32.4 36 29.16 3.1 7 21.7 49 9.61 5.7 8 45.6 64 32.49 4.4 9 39.6 81 19.36 4 10 40 100 16 2.8 11 30.8 121 7.84 2.6 12 31.2 144 6.76 2.4 13 31.2 169 5.76 5.2 14 72.8 196 27.04...
Price controls create two forms of inefficiency. Describe them and illustrate them using the supply and...
Price controls create two forms of inefficiency. Describe them and illustrate them using the supply and demand model.
Using the Patients dataset, create a scatter plot (similar to Figure 13.5) with patient’s age on...
Using the Patients dataset, create a scatter plot (similar to Figure 13.5) with patient’s age on the x-axis and length of stay on the y-axis. Make sure that you fully label this chart (title for the chart, x-axis, and y-axis). (5 points) Follow the directions in EG13.2 (Excel Guide) at the end of Chapter 13 and create a linear trend line along with the linear regression equation and R-squared value. Interpret both the linear regression equation and the R-squared value....
Create the following 3D plot in boxed format using MAPLE. Include a title and the code...
Create the following 3D plot in boxed format using MAPLE. Include a title and the code for the plot in the same page. -A pair of concentric cylinders about the z axis, with a height of 7.
Create the following 3D plot in boxed format using MAPLE. Include a title and the code...
Create the following 3D plot in boxed format using MAPLE. Include a title and the code for the plot in the same page. -3 spheres of radius 5 centered at (0,-8,0) , (0,8,0) and (0,0,0)
Create a box plot for the data given in Problem. 18, 27, 34, 52, 54, 59,...
Create a box plot for the data given in Problem. 18, 27, 34, 52, 54, 59, 61, 68, 78, 78, 82, 82, 85, 87, 91, 93, 100
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT