The mtimes operator * occurs four times in your code. The mtimes operation is only defined for numeric arrays, and so obviously in one of those four locations you have (at least) one cell array instead of a numeric array, thus the error message.
Are any of A, B and/or D cell arrays?
