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?

조회 수: 1 (최근 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?

채택된 답변

Alessandro Masullo
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
ABDULLA RAHIL
ABDULLA RAHIL 2016년 5월 5일
thanks for your help but in my case i have 290 per 1000 people in 2007 and i want to see the number in 2015
Steven Lord
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 CenterFile Exchange에서 Breaks, Knots, and Sites에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by