Determine the exponential function
3 次查看(过去 30 天)
显示 更早的评论
Based on the general census data taken from Turkish Statistical Institute, the change in the population of Turkish Republic since the year 1927 is given below:
1927 13648000
1940 17821000
1950 20947000
1960 27755000
1970 35605000
1980 44737000
1990 56473000
2000 67804000
2007 70586256
2010 73722988
A ) Determine the exponential function that best fits the data. Use the function to estimate the population in 1985.
B ) Curve fit the data with a quadratic equation (2nd order polynomial). Use the polynomial to estimate the population in 1985.
C ) Estimate the population with linear and spline interpolations.
D ) Show all the curves you find on a single plot. Place the data points as well. Do not forget to show the legend in order to distinguish which curve is for which method. Also show the grids, plot title and axis names.
Bonus : As a programmer, you can let the user choose the method to be used for curve fitting.
Using what you have learnt since the beginning of the term, it is possible for you to write a code that asks the user to choose the method and the year at which the population will be calculated. The code then calculates the population and plots the curve for the chosen mehod.
Steps :
- Load the data from a text file
- Write the methods available on the screen, giving numbers to each, and ask the user toinput the number of the preferred method
- Ask the user to enter the year
- Use “if..else” or “switch...case” to calculate the population and plot the curve, onlyfor the chosen method. Do not forget to show the data points. In addition, show thecalculated population at the chosen year with a different mark.
- On the plot, show legend, grids, plot title and axis names.
- Show the result on the screen with a meaningful sentence, i.e. “The population ofTurkey in XXXX is XXXXXXX.”
0 个评论
回答(2 个)
Matt Fig
2011-4-13
To expand on and reinforce Sean de's comment: Simply pasting a homework problem here will not result in its solution. There are no automated MATLAB server solvers here.
Please show what you have done so far, where you are stuck, and ask a specific MATLAB question. Do this and you will get plenty of help for your problem.
4 个评论
Walter Roberson
2011-4-13
That has an uneven distribution for 40 and 126, each having only half of the probability of the remaining characters.
Matt Fig
2011-4-13
But who needs ( and ~ so often? I seriously doubt that will affect the odds of producing the correct homework solution within the time allotted. ;-)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!