Problem update with changing sizes of matrices and vectors

If I understand correctly (and ran the code correctly), the problem update feature allows one to update the values of the matrices and vectors in the problem but not their sizes? If the sizes change, then one would have to initialize the solver each time it is called?

You can update the problem data and resolve only in the case that 1) the problem data is the same size and 2) the matrix-valued parts of the data have the same sparsity pattern.

Otherwise you need to make a new solver object.

Thanks. A quick follow up: it seems that one also needs to make a new solver object if the solver is inside parfor loops?

I would assume yes, since different problems would otherwise be trying to use the same solver / access the same memory space at the same time. For parallel solves you definitely need multiple solver objects.

That explains. Many thanks.