I was doing code refactor to apply parfor to some legacy code. Legacy code creates a big struct variable called 'Boot', with fields of numeric matrix.
I want to convert it to a new sliced variable "BootS" , but if I do the conversion like the attached image, Matlab give me warnings that I should preallocate it.
( iters means number of iterations.)
I tried to preallocate BootS as the code commented out , it fails with runtime errors.
Anyone has good idea to convert it elegantly??
Best Answer