Question

In: Computer Science

In MATLAB: x = [1 3 4 6 7 10 11 15 16] y = [20...

In MATLAB:

x = [1 3 4 6 7 10 11 15 16]

y = [20 24 25 30 32 34 39 41 48]

This is an exercise in numerical differentiation.

Using the central difference method where possible, find dy/dx for the data set provided. Plot results.

Solutions

Expert Solution

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

clc
clear all
close all
format long
x = [1 3 4 6 7 10 11 15 16];
y = [20 24 25 30 32 34 39 41 48];
dydx=[];
i=1;
dydx(1)=(y(i+1)-y(i))/(x(i+1)-x(i));
for i=2:length(x)-1
dydx(i)=(y(i+1)-y(i-1))/(x(i+1)-x(i-1));
end
dydx(end+1)=(y(end)-y(end-1))/(x(end)-x(end-1));
disp(dydx)
plot(x,dydx);

Kindly revert for any queries

Thanks.


Related Solutions

In MATLAB: x = [1 3 4 6 7 10 11 15 16] y = [20...
In MATLAB: x = [1 3 4 6 7 10 11 15 16] y = [20 24 25 30 32 34 39 41 48] This is an exercise in numerical differentiation. Using the central difference method where possible, find dy/dx for the data set provided. Plot results.
3 6 4 8 1 10 2 9 11 12 15 22 3 6 7 5...
3 6 4 8 1 10 2 9 11 12 15 22 3 6 7 5 8 1 12 14 Each column represents a different treatment given to sick rats. Each cell is a different rat. Use statistical analysis and use post hoc testing using contrasts to find the best treatment. Treatment 1: vitamins Treatment 2: prescription pills Treatment 3: brain surgery Treatment 4: shock therapy Treatment 5: dietary changes
y x1 x2 13 20 3 1 15 2 11 23 2 2 10 4 20...
y x1 x2 13 20 3 1 15 2 11 23 2 2 10 4 20 30 1 15 21 4 27 38 0 5 18 2 26 24 5 1 16 2 A manufacturer recorded the number of defective items (y) produced on a given day by each of ten machine operators and also recorded the average output per hour (x1) for each operator and the time in weeks from the last machine service (x2). a. What is the...
Promotional expenses(x) Sales(y 7 12 10 14 9 13 4 5 11 15 5 7 3...
Promotional expenses(x) Sales(y 7 12 10 14 9 13 4 5 11 15 5 7 3 4 a) draw the scatter plot and draw the line of best fit b) Calculate and interpret the correlation between promotional expenses and sales C) Calculate the regression equation( calculate the slope and intercept of the regression line d)Interpret the slop coefficient of regression equation e)Using the regression equation calculate the sales volume with respect to promotional expense of 4. f) Obtain the coefficient...
ID X Y 1 2 3 2 3 6 3 4 6 4 5 7 5...
ID X Y 1 2 3 2 3 6 3 4 6 4 5 7 5 8 7 6 5 7 7 6 7 8 8 8 9 7 8 10 12 11 Test the significance of the correlation coefficient. Then use math test scores (X) to predict physics test scores (Y).  Do the following: Create a scatterplot of X and Y. Write the regression equation and interpret the regression coefficients (i.e., intercept and slope). Predict the physics score for each....
Periods ​1% ​2% ​3% ​4% ​5% ​6% ​7% ​8% ​9% ​10% ​12% ​14% ​15% ​16% ​18%...
Periods ​1% ​2% ​3% ​4% ​5% ​6% ​7% ​8% ​9% ​10% ​12% ​14% ​15% ​16% ​18% ​20% 1 0.990 0.980 0.971 0.962 0.952 0.943 0.935 0.926 0.917 0.909 0.893 0.877 0.870 0.862 0.847 0.833 2 0.980 0.961 0.943 0.925 0.907 0.890 0.873 0.857 0.842 0.826 0.797 0.769 0.756 0.743 0.718 0.694 3 0.971 0.942 0.915 0.889 0.864 0.840 0.816 0.794 0.772 0.751 0.712 0.675 0.658 0.641 0.609 0.579 4 0.961 0.924 0.888 0.855 0.823 0.792 0.763 0.735 0.708 0.683 0.636...
Given are five observations for two variables, x and y. xi 1 4 11 15 20...
Given are five observations for two variables, x and y. xi 1 4 11 15 20 yi 52 57 48 16 10 a. Compute SSE, SST, and SSR. SSE [     ] (to 2 decimals) SST [     ] (to 2 decimals) SSR [     ] (to 2 decimals) b. Compute the coefficient of determination r2. Comment on the goodness of fit. [     ] (to 3 decimals) The least squares line provided an [good,bad] fit; [     ]% of the variability in y has...
Day 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15...
Day 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Number of Aides Absent 5 8 11 15 4 2 7 1 4 6 14 19 3 5 8 In which of the following ranges you can find the Upper Control Limit of the control chart? 0.1427 0.1536 0.1677 Not computable with information available In which of the following ranges you can find the Lower Control Limit of the control chart? Does not exit...
student 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15...
student 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Test score 67 67 87 89 87 77 73 74 68 72 58 98 98 70 77 Above we have the final averages of the last stats and I want to know if the class average falls within the boundaries of all my statistics classes for the past 20 years. Find the sample size, mean, and standard deviation of the data above (Table 1)....
Step 2 Data Set A x 1 2 3 4 5 6 7 y 7 7...
Step 2 Data Set A x 1 2 3 4 5 6 7 y 7 7 7 9 9 9 10 Data Set B x 1 2 3 4 5 6 7 8 9 10 11 y 4 6 6 6 8 9 9 9 10 10 10 Step 2 Find the equation for the least-squares line, and graph the line on the scatter plot. Find the sample correlation coefficient r and the coefficient of determination r2. Is r significant?...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT