Question: As specified in the following table, the earths density varies as a function of the distance from its center (r = 0): Develop a script
As specified in the following table, the earth’s density varies as a function of the distance from its center (r = 0):

Develop a script to fit these data with interp1 using the pchip option. Generate a plot showing the resulting fit along with the data points. Then use one of MATLAB’s integration functions to estimate the earth’s mass (in metric tonnes) by integrating the output of the interp1 function.
0 r, km p, g/cm 13 1100 1500 2450 3400 3630 4500 12.4 12 11.2 9.7 5.7 5.2 r, km 5380 6060 6280 p, g/cm 4.7 3.6 3.4 6380 3
Step by Step Solution
3.42 Rating (155 Votes )
There are 3 Steps involved in it
To fit the given data using the interp1 function with the pchip option we can use the following scri... View full answer
Get step-by-step solutions from verified subject matter experts
