plot x bar and R
3 views (last 30 days)
Show older comments
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 Comments
Voss
on 27 Dec 2021
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.
Answers (1)
Star Strider
on 27 Dec 2021
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'})
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 Comments
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!