help with preallocating matrix ?
1 vue (au cours des 30 derniers jours)
I want to preallocate a matrix a dynamic matrix Archive[M,6], The size of our matrix limited by 200. At beggening M=1 then add elements to Archive by using the following function:
function Add ( Archive, Solution)
while( size(Archive,1) <= 200 )
where solution is Solution[1,6].
How preallocate the Archive matrix ?
KALYAN ACHARJYA le 7 Fév 2021
If it is are fixed,can consider the extra zeros (If generated data are not sufficients to allocate all)
Without knowing the size of the data? you may do following way
Still it not perfect as preallocate with specific size. More, check with the Elapsed time, to see the time difference of execution.