MATLAB: How to skip the division of zero in three summation term.

division by zero

F=n-M-N;
syms n M N
T= symsum(symsum(symsum((1/F),n,1,3),M,1,3),N,1,3);
Hi everybody,
I am trying to solve a problem, which involving three summation terms in the Temperature, denoted as T. Each of the sum range from 1 to 3.
However, there are certain value gives division by zero condition. How can I skip this condition while it add up others non-zero terms and give me a value ?
Desperately need the helps. Thanks.

Best Answer

syms n M N
F = n-M-N;
Fz = piecewise(F == 0, 0, 1/F);
T = symsum( symsum( symsum( Fz, n, 1, 3), M, 1, 3), N, 1, 3)