From: Stefan on

You should be careful with such interpretations. But:

a=0;
b=0;

c=a/b;

if(isnan(c) && (a==0) && (b==0))
c=0;
end

Something like this perhaps.

Regards,
Stefan


"Nils Tobias " <nils.kraemer(a)uni-ulm.de> wrote in message <i2u63a$p3u$1(a)fred.mathworks.com>...
> Hi Matlab community,
>
> Matlab normaly treats division by zero like this:
> 1) 0/0 = NaN
> 2) 1/0 = Inf
>
> Is there a way to redefine these definitions. My problem is that I want - only in a special case (some sort of indicator function) - that 0/0 = 0. I know it's incorrect but maybe there's some way of doing it.
>
> Thanks a lot
> -NT