Using `bsxfun` for non-numeric data
问题 Is there an equivalent to bsxfun for non-numeric data? For example, I want to compare all pairs of strings stored in two cell-arrays: >> a = {'aa', 'bb', 'cc'}; >> b = {'dd', 'aa'}; >> bsxfun( @strcmp, a, b' ); % not working for cells :-( 回答1: I'm afraid there's no such equivalent for cell-arrays :-( As far as I can see, you can either: Follow Oleg's suggestion and use loops Use existing implementations such as mAryCellFcn or csxfun from the File Exchange. Roll your own function. For example,