www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@xregmodel/normplot.m
function h = normplot(m,X,Y,axhand) %NORMPLOT normal probability plot for model % % h = normplot(m,X,Y,axhand) % Copyright 2007-2011 The MathWorks, Inc. [data,factors]= diagnosticStats(m,X,Y); f= find( strncmp( 'Studentized residuals',factors,21 ) ); if ~isempty(f) % use studentised residuals if possible res= data(:,f(1)); s= 1; Label = factors{f(1)}; else % otherwise use normalised yhat= EvalModel(m, X); res= double(Y)-yhat; s= std(res); Label = 'Normalized residuals'; end if s>0 z= res/s; h=mv_normplot(z,axhand); set(h,'Parent',axhand,'HitTest','off'); set(h(1),'Tag','main line',... 'HitTest','on'); h= h(1); xH=get(axhand,'XLabel'); set(xH,'String','Probability',... 'FontWeight','bold'); yH=get(axhand,'YLabel'); set(yH,'String',Label,... 'FontWeight','bold'); else h = []; end view(axhand, 2); mv_rotate3d(axhand,'off');