function a_db = diff(a_db, props)
% diff - Creates a tests_db by taking the derivative of all tests.
% a_db = diff(a_db, props)
% Applies the diff function to whole DB. The resulting DB will have one less row.
% a_db: A tests_db object.
% props: Optional properties.
% a_db: The resulting tests_db.
% See also: diff, tests_3D_db/getDiff2DDB
% Author: Cengiz Gunay <email@example.com>, 2006/05/24
% Copyright (c) 2007 Cengiz Gunay <firstname.lastname@example.org>.
% 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 ~ exist('props', 'var')
props = struct();
if dbsize(a_db, 1) <= 1
error('More than one row is required to take diffs!');
a_db = set(a_db, 'id', [ 'diffed ' get(a_db, 'id') ]);
a_db = set(a_db, 'data', diff(get(a_db, 'data')));