www.gusucode.com > stats 源码程序 matlab案例代码 > stats/GageRRStudyExample.m

    %% Gage R&R Study
% Simulate a measurement system by randomly generating the operators,
% parts, and the measurements, |y| , operators do on the parts.

% Copyright 2015 The MathWorks, Inc.

rng(1234,'twister')               % for reproducibility   
y = randn(100,1);                 % measurements
part = ceil(3*rand(100,1));       % parts
operator = ceil(4*rand(100,1));   % operators
%%
% Conduct a gage R&R study for this system using a mixed ANOVA model
% without interactions.
gagerr(y,{part, operator},'randomoperator',true)