clear
- y=rand(30,7);
- x=rand(30,1);
- for i=1:7;
- result(i)=ols(y(:,i),x); %目的想把不同的7个因变量的回归结果保存到不同的result,但这样写是错的,怎么修改。
- end
[color=rgb(51, 102, 153) !important]复制代码
- %另外我想使用fopen的方式吧不同的结果导出到excel文件,然而使用下面的方法也是错的,怎么修改?
- for i=1:7;
- str1='out';
- str2=num2str(i);
- str=strcat(str1,str2); %在循环语句下想获得out1-out7.
- fid = fopen('str.xls','a'); out1-out7
- .......
- prt(result(i),vnames,fid);%目的想把result1-result7,保存到str.xls文件中,怎么修改?
- end
[color=rgb(51, 102, 153) !important]复制代码
[color=rgb(51, 102, 153) !important]
|