diff extra/NaN/inst/covm.m @ 12640:de98e4cb9248 octave-forge

check for sparse matrices and and convert to full if needed
author schloegl
date Thu, 18 Jun 2015 15:09:49 +0000
parents e0a8637557ab
children
line wrap: on
line diff
--- a/extra/NaN/inst/covm.m	Thu Jun 18 08:23:13 2015 +0000
+++ b/extra/NaN/inst/covm.m	Thu Jun 18 15:09:49 2015 +0000
@@ -143,6 +143,12 @@
                 end;
 	end;
 
+	if issparse(X) || issparse(Y), 
+		fprintf(2,'sumskipnan: sparse matrix converted to full matrix\n');
+		X=full(X); 
+		Y=full(Y); 
+	end;
+
 	[CC,NN] = covm_mex(real(X), real(Y), FLAG_NANS_OCCURED, W);
 	%% complex matrices 
 	if ~isreal(X) && ~isreal(Y)