function err = total_error(a, b) err = sum(sum(abs(a - b))); endfunction