i have a number of cars in 2007 per 1000 people which is 290 , how can I make forecast the number at 2014, by simple way in matlab?
3 ビュー (過去 30 日間)
古いコメントを表示
i have a number of cars in 2007 per 1000 people which is 290 , how can I make forecast the number at 2014, by simple way in matlab?
0 件のコメント
採用された回答
Alessandro Masullo
2016 年 5 月 5 日
years = 2001:2005;
cars = 100:100:500;
new_year = 2010;
interp1(years,cars,new_year,'linear','extrap')
As an alternative, you can use 'spline' instead of linear.
2 件のコメント
Steven Lord
2016 年 5 月 5 日
Extrapolating from a single data point, the "right" answer could be anything. So just choose the answer to Life, the Universe, and Everything: 42.
answer = 42;
If you have more than just a single data point, and if you're careful about not extrapolating too far, use interp1 as Alessandro showed.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Splines についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!