From maintainers-request at octave dot org Tue Nov 2 14:20:48 2004 Subject: Re: New sparse class From: "Paul Thomas" To: Date: Tue, 2 Nov 2004 21:20:27 +0100 >Also the "./" operator > for two sparse matrices doesn't include the NaN values as implied by the > division by the zero elements of the sparse matrix. This is how Matlab > treats this even though it is inconsistent with full matrices. > R12 seems to do the right thing >> b = sparse( [1 2] , [2 1] , [5 0] , 2 , 2) b = (1,2) 5 >> a = sparse( [1 2] , [2 1] , [5 5] , 2 , 2) a = (2,1) 5 (1,2) 5 >> a ./ b Warning: Divide by zero. ans = (1,1) NaN (2,1) Inf (1,2) 1 (2,2) NaN >> full(a) ./ full(b) Warning: Divide by zero. ans = NaN 1 Inf NaN Paul T