make xref more efficient, write to .m file
From @MichelJuillard
For large models it is really slow. I think that we should
- add an Dynare option to compute them and write them in
*.m
file (unless it is required for a particular computation, but it is not yet the case) - change the Matlab code:
{end+1}
is very elegant but very inefficient because Matlab makes memory allocations several times. It is better to initialize first the cellarray and use an index for the assignment. The size isM_.endo_nbr
andM_.eq_nbr