C are scalars.
Z has the same class and size as X and Y . Use imlincomb to perform a series of arithmetic operations on a pair of images, rather than nesting calls to individual arithmetic functions, such as imadd and immultiply . When you nest calls to the arithmetic functions, and the input arrays have integer class, then each function truncates and rounds the result before passing it to the next function, thus losing accuracy in the final result. If X is an integer array, elements of Z that exceed the range of the integer type are truncated, and fractional values are rounded. To illustrate how imlincomb performs all the arithmetic operations before truncating the result, compare the results of calculating the average of two arrays, X and Y , using nested arithmetic functions and then using imlincomb .