使用Parfor节省时间和内存?
prova.mat
for w=1:100 for p=1:9 A{p}=randn(100,1); end baseA_.A=A; eval(['baseA.A' num2str(w) '= baseA_;'])endsave(sprintf('prova.mat'),'-v7.3', 'baseA')
1x9 cell
A1
9
904x5, 913x5, 1722x5, 4136x5, 9180x5, 3174x5, 5970x5, 4455x5, 340068x5
Aj
clear allload provaticparfor w=1:100 indA=sprintf('A%d', w); Aarr=baseA.(indA).A; Boot=[]; for p=1:9 C=randn(100,1).*Aarr{p}; Boot=[Boot; C]; end D{w}=Boot;endtoc
parfor
4
parfor
for
C
baseA
parfor
for
baseA
慕妹3146593