function rows = isnanrows(db)
% isnanrows - Finds rows with any NaN values. Returns logical indices of db rows.
% rows = isnanrows(db)
% Some operations need that no NaN values exist in the matrix. This method
% can be used to find and then remove NaN-contaminated rows from DB. Note
% that sometimes no rows can be found, and some columns should be discarded
% before this operation.
% db: A tests_db object.
% rows: A logical vector to be used in indexing db objects or passed
% through other logical operators.
% See also: isnan, tests_db
% Author: Cengiz Gunay <firstname.lastname@example.org>, 2004/11/08
% Copyright (c) 2007 Cengiz Gunay <email@example.com>.
% This work is licensed under the Academic Free License ("AFL")
% v. 3.0. To view a copy of this license, please look at the COPYING
% file distributed with this software or visit
if ndims(db.data) > 2
error('Cannot work in three dimensions.');
% Find all rows with any NaNs in them
rows = any(isnan(db.data), 2);