I found that discussion: http://www.mathworks.com/matlabcentral/newsreader/view_thread/294626
The reason is efficiency and doesn't seem to apply to character matrices like M_.endo_names (even if I think that one day we should change it to cellarray)
Matlab wording has evolved. It use to be "will be removed in the future" and in recent Matlab version "usage is discouraged". My main worry was to avoid using strmatch() to prepare for removal, but if this threat has disappeared I guess that we can keep using it, at least with character matrices.
Maybe we should do dyn_strmatch() to use str(n)cmp() with cellarrays.
Best
Michel
Johannes Pfeifer writes:
Thanks for the comments. I am aware that Mathworks for some reason discourages using strmatch. But I ignore them , because I think there is no suitable substitute. Your construct with find and strcmp is cumbersome and does not work. The reason is that M_.endo_names is a character array, but strcmp only works with cell arrays. I really dislike using something like
find(strcmp(cellstr(M_.endo_names,var_name)))
But if you have a strong preference for this, I can change it.
I already updated the unit test to get rid of the evals.
Johannes Pfeifer Friesenwall 104 50672 Köln Mobil: +49-(0)170-6936820 jpfeifer@gmx.de
-----Ursprüngliche Nachricht----- Von: Michel Juillard [mailto:michel.juillard@mjui.fr] Gesendet: Donnerstag, 20. November 2014 22:52 An: Johannes Pfeifer Betreff: pull requests
I made recommendations on some of you pull requests. It is possible that my suggestions don't work.
Best