A control chart is a statistical tool used in quality control to monitor and control a process by plotting data points over time and comparing them to control limits. It helps in identifying whether a process is 'in control' or 'out of control'.

Here is an example of a control chart using Matlab codes:

Suppose we are monitoring the weight of a product in a manufacturing process. We have collected 30 samples of the weight and want to analyze whether the process is in control or not.

First, we need to calculate the mean and standard deviation of the sample:

data = [23.4, 24.1, 23.8, 24.2, 23.6, 24.0, 24.3, 23.9, 23.5, 23.7, 24.2, 23.6, 23.9, 24.1, 23.8, 23.6, 24.0, 24.3, 23.7, 23.9, 24.2, 24.0, 23.5, 23.8, 24.1, 24.2, 23.7, 23.9, 24.0, 23.6, 24.1];
mean_data = mean(data);
std_data = std(data);

Next, we need to calculate the upper control limit (UCL) and lower control limit (LCL) for the control chart. We can use the formula:

UCL = mean_data + 3 * std_data; LCL = mean_data - 3 * std_data;

UCL = mean_data + 3 * std_data;
LCL = mean_data - 3 * std_data;

We can now plot the data points and the control limits on a chart using the plot function:

x = 1:length(data);
plot(x, data, 'o');
hold on;
plot(x, repmat(mean_data, 1, length(data)), 'r-');
plot(x, repmat(UCL, 1, length(data)), 'b--');
plot(x, repmat(LCL, 1, length(data)), 'b--');
xlabel('Sample');
ylabel('Weight');
title('Weight Control Chart');
legend('Data', 'Mean', 'UCL', 'LCL');

The resulting control chart will show the data points, mean, UCL and LCL:

Control chart example

We can see that all data points fall within the control limits, indicating that the process is 'in control'. If any data point falls outside the control limits, it would indicate that the process is 'out of control' and requires investigation.


原文地址: https://www.cveoy.top/t/topic/nGT5 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录