given a cell array of strings, I want to build one regexprep rule, so that different string types are replaced by a certain number. I.e:
my_cell = {'ok', 'ok', 'bad', 'broken', 'bad', 'broken', 'ok'};
I know how to replace each string type one by one, i.e:
my_cell = regexprep(my_cell,'ok$','1');
but ideally I would like to build one rule, so that ok will be replaced with 1, bad will be replaced with 0 and broken will be replaced with -1.
any hints on how to do this?