I am working on code in Matlab, where I have many variables that need to be pre-allocated (each variable has a length of 8760x1). Values ββare generated in a for loop:
a=zeros(8760,1); b=zeros(8760,1); (...) for i=1:8760 a(i)=[some code]; b(i)=[some code]; (...) end
However, seeing that I have many of these variables, I want to redirect the parameters to another file (cleaner).
preallocate.m
a=zeros(8760,1); b=zeros(8760,1); ...
main.m
preallocate for i=1:8760 a(i)=[some code]; b(i)=[some code]; (...) end
Will the preinstallation in another matlab file be as effective as in the same file as the executable? Other offers?
source share