What does NaN mean here?
7 views (last 30 days)
Ahmet Cecen on 28 Dec 2016
Edited: Ahmet Cecen on 28 Dec 2016
Looks like the code intended to initialize a matrix filled with NaNs and does this by adding NaN to a zero matrix. Any number + NaN is NaN.
You could achieve the same effect with:
aux = NaN(colK);
One common reason you would use NaN instead of 0 is to differentiate when you actually have a value of 0 (say 0 Celsius) versus you have no idea what that value is.