plot x bar and R
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
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
2021-12-27
I have absolutely no idea what
and R are.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/845400/image.png)
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'})
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.
.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!