Can you have a function for multiple scripts that are growing in size?
이전 댓글 표시
I have 36 scrpits that I run from a major script. My goal is to increase the performance as much as possible, since it now is really slow. Every script has the output GUD and I2 that I save as AUG1, AUG2... and AUI1, AUI2...
for i=1:36
if i=1
run 'H1'
end
if i=2
run 'H2'
end
.
.
.
save(sprintf('Urbanv/Appu/AUG%d',i), 'GUD');
save(sprintf('Urbanv/Appu/AUI%d',i), 'I2');
end
My problem is that the scripts are growing in size, so I do not know how to make a function that can replace the for loop above
For example, H1 now looks like this:
for i2=1:size(Hcombos, 1)
C=Hcombos(i2)
%for loop specific for H1
%Variable example: V1
end
end
And H2 will look like this
for i2=1:size(Hcombos, 1)
C=Hcombos(i2)
C2=Hcombos(i2,2)
%for loop specific for H1
%Variable example: V1
%for loop specific for H2
%Variable example: V2
%for loop that ensures that V1 and V2 are not the same
end
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!