#141: Replace strmatch which is a deprecated function in Matlab ---------------------+------------------------------------------------------ Reporter: houtanb | Owner: Type: bug | Status: new Priority: trivial | Milestone: 5.0 Component: General | Version: Keywords: | ---------------------+------------------------------------------------------ Changes (by sebastien):
* milestone: 4.3 => 5.0
Comment:
Note that strncmp only accept cell arrays, not string arrays. So one has to convert M_.endo_names to a cell array with cellstr. Also, strncmp considers trailing whitespace.
The safe equivalent of:
strmatch(var_list_(i,:),M_.endo_names)
is therefore:
n = length(strtrim(var_list_(i,:)); find(strncmp(strtrim(var_list_(i,:)), cellstr(M_.endo_names), n);
Maybe we should consider switching to cell arrays instead of string arrays for M_.*_names.