Determine if all input arguments are either scalar or of common size. If so, err is zero, and yi is a matrix of the common size with all entries equal to xi if this is a scalar or xi otherwise. If the inputs cannot be brought to a common size, errorcode is 1, and yi is xi. For example,
[errorcode, a, b] = common_size ([1 2; 3 4], 5) errorcode = 0 a = [ 1, 2; 3, 4 ] b = [ 5, 5; 5, 5 ]This is useful for implementing functions where arguments can either be scalars or of common size.