upj(1:37,1:11,1:108)=0.0;
for sj=1:108
for gd=1:11
for wd=1:37
for jd=1,144;
upj(wd,gd,sj)=upj(wd,gd,sj)+utq(jd,wd,gd,sj);
end
upj(wd,gd,sj)=upj(wd,gd,sj)/(jd);
end
end
end
upjj(1:144,1:37,1:11,1:108)=0.0;
for sj=1,108;
for gd=1:11
for wd=1:37
for jd=1:144
upjj(jd,wd,gd,sj)=upj(wd,gd,sj)+upjj(jd,wd,gd,sj);
end
end
end
end
up(1:144,1:37,1:11,1:108)=0.0;
for sj=1,108;
for gd=1:11
for wd=1:37
for jd=1:144
up(jd,wd,gd,sj)=utq(jd,wd,gd,sj)-upjj(jd,wd,gd,sj);
end
end
end
end
答主你好,我按照你的方法运行了repmat函数,报错为Error using repmat Too many input arguments.于是我就改成了repmat(uave,m,1,1),还是报错,改成repmat(uave,m,1)生成了一个(m*n,lev,time)3维的数组,所以这个函数可以这么用来扩展维数吗?help里的解释也是没看懂啊