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

    %% Compute Capability Indices
% Simulate a sample from a process with a mean of 3 and a standard
% deviation of 0.005.

% Copyright 2015 The MathWorks, Inc.

rng default; % for reproducibility
data = normrnd(3,0.005,100,1);
%%
% Compute capability indices if the process has an upper specification
% limit of 3.01 and a lower specification limit of 2.99.
S = capability(data,[2.99 3.01])
%%
% Visualize the specification and process widths.
capaplot(data,[2.99 3.01]);
grid on