www.gusucode.com > mbctools 工具箱 matlab 源码程序 > mbctools/+mbcmodelview/ValidationData.m
classdef ValidationData < mbcmodelview.BaseScatterPlot %ValidationResiduals validation residuals scatter plot view % Copyright 2015-2015 The MathWorks, Inc. and Ford Global Technologies, Inc. properties (Constant) ViewInfo= { @mbcmodelview.ValidationData; '&Validation Data'; xregrespath('validationscatter.bmp'); 'Validation data'; 1}; end methods function obj = ValidationData(varargin) %ValidationData constructor obj@mbcmodelview.BaseScatterPlot(varargin{:}); end function str = gettitle(obj) %GETTITLE Return string to use as title for view % % STR = GETTITLE(OBJ) returns a string that should be used as a title for % the container the view sits in. str = 'Validation Data'; end % gettitle end methods(Access=protected) function update(obj) % updates scatter and special plots % Get the outlier line from the View structure % store modeldev data in userdata ms = obj.MessageService; labH= get(obj.Axes,'Title'); % Check the data is ok... if isempty(ms.ValidationXData) set(obj.ContentHandle,'Data',[]); set(labH,'String',['Validation - ',ms.Title],'FontWeight','normal'); elseif ~obj.MessageService.Status % if not OK % Clean up the scatter-2d axes. set(obj.ContentHandle,'Data',[]); % state what is going on msg = 'Model not fitted'; set(labH,'String',[ms.Title,msg],'FontWeight','bold'); else set(labH,'String',['Validation - ',ms.Title],'FontWeight','normal'); [data,factors] = validationDiagnostics(ms); % === PLOT SCATTER GRAPH2D === set(obj.Graph2D,'limits',repmat({'auto'},1,size(data,2)),... 'data',data,... 'factors',factors); if isempty(obj.XFactor) if ms.NumInputs==1 obj.XFactor = factors{1}; else obj.XFactor = 'Predicted <response>'; end end xf = matchFactor(obj,obj.XFactor,factors,get(obj.Graph2D, 'CurrentYFactor')); set( obj.Graph2D, 'CurrentXFactor',xf); yf = matchFactor(obj,obj.YFactor,factors,get(obj.Graph2D, 'CurrentXFactor')); if ~isempty(yf); set( obj.Graph2D, 'CurrentYFactor',yf); end set(obj.Line,'Marker','^',... 'MarkerEdgeColor','k',... 'MarkerFaceColor',[50, 200, 50]/255,... 'MarkerSize',5); end end end end