function out = valid(cvdata)
% Determine if the cvdata object represents active up-to date data.
% Invalid data results when a model is closed or a model is changed
% between simulations.

%   Copyright 2007-2018 The MathWorks, Inc.

    if ~cvdata.isLoaded
        cvdata.load();
    end

	out = false;
	id = cvdata.id;
	
    if (id ~= 0) && ...
       (~cv('ishandle', id) || cv('get',id,'.isa')~= cv('get','default','testdata.isa'))
        return;
    end

	out = validRoot(cvdata);

	

