Home > Back-end >  Grey metabolism model matlab code
Grey metabolism model matlab code

Time:10-02

Function. [result]=metabolism_gm11 (x0, predict_num)
X0=[37998.52 43162.73 49604.03 65012.75 68216.09 71112.81 72959.91];
Predict_num=5
% function are: using metabolic GM (1, 1) model to predict data

% input variables% x0:
the primitive data to predict% predict_num: backward prediction of nper

% output variablesThe projections % result:
Result=zeros (predict_num, 1); % initial enter to save the predictive value of vector
For I=1: predict_num
The result (I)=gm11 (x0, 1); % will predict a period to save the result to the result of
X0=[x0 (2: end); the result (I));
% update x0 vector, this time x0 new prediction information, and deleted the beginning that vector sequence length unchanged
End
End

After running the metabolism model, there is always error,
Error metabolism_gm11 (line 12)
The result (I)=gm11 (x0, 1); % will predict a period to save the result to the result of
Help you a great god, how should adjust
  • Related