plot x bar and R

4 次查看(过去 30 天)
karim Soussou
karim Soussou 2021-12-26
回答: Star Strider 2021-12-27
i have some set of data that i need to plot x bar and R to
s No 1 2 3 4
1 44 26 24 34
2 50 48 51 43
3 32 28 26 22
4 52 55 56 44
5 16 16 21 26
6 36 36 35 31
7 21 22 18 21
8 29 21 23 22
9 26 46 44 14
10 24 22 22 44
11 18 24 24 49
12 24 20 26 23
13 19 21 27 28
14 8 11 12 12
15 24 18 27 24
16 56 52 56 50
17 32 22 18 25
18 8 12 11 17
19 51 54 52 49
  3 个评论
karim Soussou
karim Soussou 2021-12-27
I don’t know how to enter all this data to plot the x bar and R
Voss
Voss 2021-12-27
Where is the data now? In a text file? If it is in a file (of any kind), please attach the file here so that people can advise you on the correct way to get the data into your MATLAB workspace.

请先登录,再进行评论。

回答(1 个)

Star Strider
Star Strider 2021-12-27
I have absolutely no idea what and R are.
Two possibilities —
M = [1 44 26 24 34
2 50 48 51 43
3 32 28 26 22
4 52 55 56 44
5 16 16 21 26
6 36 36 35 31
7 21 22 18 21
8 29 21 23 22
9 26 46 44 14
10 24 22 22 44
11 18 24 24 49
12 24 20 26 23
13 19 21 27 28
14 8 11 12 12
15 24 18 27 24
16 56 52 56 50
17 32 22 18 25
18 8 12 11 17
19 51 54 52 49];
T1 = array2table(M, 'VariableNames',{'s No','1','2','3','4'})
T1 = 19×5 table
s No 1 2 3 4 ____ __ __ __ __ 1 44 26 24 34 2 50 48 51 43 3 32 28 26 22 4 52 55 56 44 5 16 16 21 26 6 36 36 35 31 7 21 22 18 21 8 29 21 23 22 9 26 46 44 14 10 24 22 22 44 11 18 24 24 49 12 24 20 26 23 13 19 21 27 28 14 8 11 12 12 15 24 18 27 24 16 56 52 56 50
VN = T1.Properties.VariableNames;
figure
plot(T1.('s No'), T1{:,2:5})
grid
hl = legend(VN{2:5}, 'Location','SW');
title(hl, '$\bar{x}$', 'Interpreter','latex')
xlabel('s No')
ylabel('R')
figure
surfc(T1{:,2:5})
yticks(T1{:,1})
xlabel(['$' VN{1} '$'], 'Interpreter','latex')
ylabel('$\bar{x}$', 'Interpreter','latex')
zlabel('$R$', 'Interpreter','latex')
Make apopropriate changes to get the desired result.
.

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by