Unrecognized function or variable 'ytot'

Please use the consolidated version at Irf function: not extracting values of dr, or other inputs - #5 by injeb

In your present code the issue is that

    i_tmp = strmatch(var_list(i,:),M_.endo_names,'exact');

should be

    i_tmp = strmatch(var_list(i),M_.endo_names,'exact');

to reflect the use of cell arrays instead of character arrays.