0
早上好,保存所有循环结果
我想我的问题一定很简单,但我不知道该怎么做。我有一个循环,我想'保存'结果。问题出在代码我只能保存'最后'列,而不是全部。代码如下:
b = xlsread('Data.xls', 'Sheet1'); %here I'm reading the excel data
d= size(b); % the size of the input table is 8 x 16 columns.
cols= d(:,2);
Results=[]
for a=b(:,2:cols)
n= 2;
m2 = ar(a,n);
K=6;
hf2=forecast(m2,a,K);
for a=b(:,2:cols) % here I try to save the results but it only save the 'last column', not all the columns.
Results=[forecast(m2,a,K)]
end
end
可能是什么问题?
在此先感谢! :)