numbers - Formula with sum total on Matlab -
i have formula: |xi-(1/n)*∑x-i|
, , trying apply cell-type variable b
27 rows * 10 columns
in matlab, x = b(:,10)
, i = analyst
, –i= other analysts
w/ exception analyst i.
i having problems in applying sum function
, putting abs function
, cell2mat
. have far:
b(:,11)=(abs(cell2mat(b(:,10)) - cell2mat((1./size(b,1))*sum(b(:,10)))));
i sum of rows except
1 corresponds analyst i.
can me? help.
try code:
b(:,11)=num2cell(abs(cell2mat(b(:,10))-((1/size(b,1))*sum(cell2mat(b(:,10))))));
for example: here "b"
27 x 10
cell array.
b =
[35] [76] [68] [59] [13] [63] [ 35] [ 47] [30] [ 7] [15] [38] [50] [25] [21] [58] [ 45] [ 92] [ 5] [79] [59] [22] [19] [67] [15] [ 6] [ 6] [ 11] [51] [34] [27] [80] [50] [ 9] [19] [94] [ 18] [ 75] [77] [61] [ 5] [95] [15] [63] [ 5] [73] [ 67] [ 74] [64] [75] [76] [33] [ 6] [67] [64] [74] [ 34] [ 57] [ 9] [11] [25] [68] [86] [73] [29] [ 7] [ 90] [ 19] [ 9] [13] [45] [44] [57] [90] [54] [87] [ 12] [ 60] [78] [55] [69] [84] [93] [99] [70] [94] [ 99] [ 30] [91] [49] [36] [77] [70] [77] [50] [99] [ 54] [ 14] [54] [90] [74] [17] [59] [59] [54] [86] [ 71] [ 22] [11] [80] [40] [87] [82] [93] [45] [79] [100] [ 90] [83] [74] [69] [99] [88] [59] [13] [52] [ 29] [ 8] [34] [ 6] [71] [52] [99] [ 2] [50] [18] [ 42] [ 25] [30] [ 8] [45] [89] [ 1] [13] [86] [40] [ 47] [ 6] [75] [ 9] [ 2] [59] [87] [87] [88] [14] [ 77] [ 45] [ 2] [80] [34] [16] [62] [49] [28] [ 4] [ 82] [ 2] [ 5] [95] [43] [20] [99] [85] [21] [94] [ 11] [ 90] [67] [69] [28] [41] [53] [21] [57] [31] [ 18] [ 20] [61] [14] [20] [75] [48] [56] [65] [30] [ 36] [ 10] [53] [73] [83] [83] [81] [63] [42] [34] [ 6] [ 31] [73] [12] [43] [79] [23] [ 4] [21] [47] [ 53] [ 46] [71] [12] [89] [32] [50] [62] [95] [65] [ 34] [ 11] [79] [65] [40] [54] [91] [37] [ 9] [ 3] [ 18] [100] [29] [33] [77] [ 9] [58] [ 5] [11] [85] [ 21] [ 34] [70] [66] [40] [12] [85] [49] [15] [56] [ 91] [ 30] [56] [75] [81] [14] [74] [20] [17] [86] [ 68] [ 7] [40] [59]
after executing aforementioned code:
b = columns 1 through 10 [35] [76] [68] [59] [13] [63] [ 35] [ 47] [30] [ 7] [15] [38] [50] [25] [21] [58] [ 45] [ 92] [ 5] [79] [59] [22] [19] [67] [15] [ 6] [ 6] [ 11] [51] [34] [27] [80] [50] [ 9] [19] [94] [ 18] [ 75] [77] [61] [ 5] [95] [15] [63] [ 5] [73] [ 67] [ 74] [64] [75] [76] [33] [ 6] [67] [64] [74] [ 34] [ 57] [ 9] [11] [25] [68] [86] [73] [29] [ 7] [ 90] [ 19] [ 9] [13] [45] [44] [57] [90] [54] [87] [ 12] [ 60] [78] [55] [69] [84] [93] [99] [70] [94] [ 99] [ 30] [91] [49] [36] [77] [70] [77] [50] [99] [ 54] [ 14] [54] [90] [74] [17] [59] [59] [54] [86] [ 71] [ 22] [11] [80] [40] [87] [82] [93] [45] [79] [100] [ 90] [83] [74] [69] [99] [88] [59] [13] [52] [ 29] [ 8] [34] [ 6] [71] [52] [99] [ 2] [50] [18] [ 42] [ 25] [30] [ 8] [45] [89] [ 1] [13] [86] [40] [ 47] [ 6] [75] [ 9] [ 2] [59] [87] [87] [88] [14] [ 77] [ 45] [ 2] [80] [34] [16] [62] [49] [28] [ 4] [ 82] [ 2] [ 5] [95] [43] [20] [99] [85] [21] [94] [ 11] [ 90] [67] [69] [28] [41] [53] [21] [57] [31] [ 18] [ 20] [61] [14] [20] [75] [48] [56] [65] [30] [ 36] [ 10] [53] [73] [83] [83] [81] [63] [42] [34] [ 6] [ 31] [73] [12] [43] [79] [23] [ 4] [21] [47] [ 53] [ 46] [71] [12] [89] [32] [50] [62] [95] [65] [ 34] [ 11] [79] [65] [40] [54] [91] [37] [ 9] [ 3] [ 18] [100] [29] [33] [77] [ 9] [58] [ 5] [11] [85] [ 21] [ 34] [70] [66] [40] [12] [85] [49] [15] [56] [ 91] [ 30] [56] [75] [81] [14] [74] [20] [17] [86] [ 68] [ 7] [40] [59] column 11 [41.2963] [30.7037] [14.2963] [12.7037] [26.7037] [37.2963] [35.2963] [ 6.7037] [ 0.7037] [41.7037] [31.7037] [25.7037] [42.2963] [40.2963] [39.2963] [31.7037] [46.7037] [20.7037] [34.2963] [24.7037] [36.2963] [36.2963] [16.7037] [15.2963] [17.7037] [26.7037] [10.7037]
Comments
Post a Comment