clear
clc
% výpoèet pøesnosti ultrazvukových dálkomìrù
%naètení dat do promìnných
%pøibližné promìøované vzdálenosti
A = load ('10cm.txt');
B = load ('20cm.txt');
C = load ('30cm.txt');
D = load ('40cm.txt');
E = load ('50cm.txt');
F = load ('60cm.txt');
G = load ('70cm.txt');
H = load ('80cm.txt');
I = load ('90cm.txt');
J = load ('100cm.txt');
K = load ('110cm.txt');
L = load ('120cm.txt');
M = load ('130cm.txt');
N = load ('140cm.txt');
O = load ('150cm.txt');
P = load ('160cm.txt');
Q = load ('170cm.txt');
R = load ('180cm.txt');
S = load ('190cm.txt');
T = load ('200cm.txt');
U = load ('210cm.txt');
V = load ('215cm.txt');
% diferenèní odsazení každé vzdálenosti
a = load ('10,5cm.txt');
b = load ('20,5cm.txt');
c = load ('30,5cm.txt');
d = load ('40,5cm.txt');
e = load ('50,5cm.txt');
f = load ('60,5cm.txt');
g = load ('70,5cm.txt');
h = load ('80,5cm.txt');
i = load ('90,5cm.txt');
j = load ('100,5cm.txt');
k = load ('110,5cm.txt');
l = load ('120,5cm.txt');
m1 = load ('130,5cm.txt');
n1 = load ('140,5cm.txt');
o = load ('150,5cm.txt');
p = load ('160,5cm.txt');
q = load ('170,5cm.txt');
r = load ('180,5cm.txt');
s = load ('190,5cm.txt');
t = load ('200,5cm.txt');
u = load ('210,5cm.txt');
v = load ('215,5cm.txt');
%výpoèet prùmìrných mìøených vzdáleností
%poèet mìøení pro urèení jedné vzdálenosti pomoci snímaèù je n = 5
n = 5;
%mìøení je provádìno ve 4 etapách m
m = 4;
%% výpoèet prùmìrných hodnot
prum1 = [sum(A(1:5,1))/n, sum(A(1:5,2))/n, sum(A(1:5,3))/n,sum(A(1:5,4))/n;
         sum(A(6:10,1))/n, sum(A(6:10,2))/n, sum(A(6:10,3))/n,sum(A(6:10,4))/n;
         sum(A(11:15,1))/n, sum(A(11:15,2))/n, sum(A(11:15,3))/n,sum(A(11:15,4))/n]; 
prum1a = [sum(a(1:5,1))/n, sum(a(1:5,2))/n, sum(a(1:5,3))/n,sum(a(1:5,4))/n;
         sum(a(6:10,1))/n, sum(a(6:10,2))/n, sum(a(6:10,3))/n,sum(a(6:10,4))/n;
         sum(a(11:15,1))/n, sum(a(11:15,2))/n, sum(a(11:15,3))/n,sum(a(11:15,4))/n]; 
prum2 = [sum(B(1:5,1))/n, sum(B(1:5,2))/n, sum(B(1:5,3))/n,sum(B(1:5,4))/n;
         sum(B(6:10,1))/n, sum(B(6:10,2))/n, sum(B(6:10,3))/n,sum(B(6:10,4))/n;
         sum(B(11:15,1))/n, sum(B(11:15,2))/n, sum(B(11:15,3))/n,sum(B(11:15,4))/n]; 
prum2a = [sum(b(1:5,1))/n, sum(b(1:5,2))/n, sum(b(1:5,3))/n,sum(b(1:5,4))/n;
         sum(b(6:10,1))/n, sum(b(6:10,2))/n, sum(b(6:10,3))/n,sum(b(6:10,4))/n;
         sum(b(11:15,1))/n, sum(b(11:15,2))/n, sum(b(11:15,3))/n,sum(b(11:15,4))/n]; 
prum3 = [sum(C(1:5,1))/n, sum(C(1:5,2))/n, sum(C(1:5,3))/n,sum(C(1:5,4))/n;
         sum(C(6:10,1))/n, sum(C(6:10,2))/n, sum(C(6:10,3))/n,sum(C(6:10,4))/n;
         sum(C(11:15,1))/n, sum(C(11:15,2))/n, sum(C(11:15,3))/n,sum(C(11:15,4))/n]; 
prum3a = [sum(c(1:5,1))/n, sum(c(1:5,2))/n, sum(c(1:5,3))/n,sum(c(1:5,4))/n;
         sum(c(6:10,1))/n, sum(c(6:10,2))/n, sum(c(6:10,3))/n,sum(c(6:10,4))/n;
         sum(c(11:15,1))/n, sum(c(11:15,2))/n, sum(c(11:15,3))/n,sum(c(11:15,4))/n]; 
prum4 = [sum(D(1:5,1))/n, sum(D(1:5,2))/n, sum(D(1:5,3))/n,sum(D(1:5,4))/n;
         sum(D(6:10,1))/n, sum(D(6:10,2))/n, sum(D(6:10,3))/n,sum(D(6:10,4))/n;
         sum(D(11:15,1))/n, sum(D(11:15,2))/n, sum(D(11:15,3))/n,sum(D(11:15,4))/n]; 
prum4a = [sum(d(1:5,1))/n, sum(d(1:5,2))/n, sum(d(1:5,3))/n,sum(d(1:5,4))/n;
         sum(d(6:10,1))/n, sum(d(6:10,2))/n, sum(d(6:10,3))/n,sum(d(6:10,4))/n;
         sum(d(11:15,1))/n, sum(d(11:15,2))/n, sum(d(11:15,3))/n,sum(d(11:15,4))/n]; 
prum5 = [sum(E(1:5,1))/n, sum(E(1:5,2))/n, sum(E(1:5,3))/n,sum(E(1:5,4))/n;
         sum(E(6:10,1))/n, sum(E(6:10,2))/n, sum(E(6:10,3))/n,sum(E(6:10,4))/n;
         sum(E(11:15,1))/n, sum(E(11:15,2))/n, sum(E(11:15,3))/n,sum(E(11:15,4))/n]; 
prum5a = [sum(e(1:5,1))/n, sum(e(1:5,2))/n, sum(e(1:5,3))/n,sum(e(1:5,4))/n;
         sum(e(6:10,1))/n, sum(e(6:10,2))/n, sum(e(6:10,3))/n,sum(e(6:10,4))/n;
         sum(e(11:15,1))/n, sum(e(11:15,2))/n, sum(e(11:15,3))/n,sum(e(11:15,4))/n]; 
prum6 = [sum(F(1:5,1))/n, sum(F(1:5,2))/n, sum(F(1:5,3))/n,sum(F(1:5,4))/n;
         sum(F(6:10,1))/n, sum(F(6:10,2))/n, sum(F(6:10,3))/n,sum(F(6:10,4))/n;
         sum(F(11:15,1))/n, sum(F(11:15,2))/n, sum(F(11:15,3))/n,sum(F(11:15,4))/n]; 
prum6a = [sum(f(1:5,1))/n, sum(f(1:5,2))/n, sum(f(1:5,3))/n,sum(f(1:5,4))/n;
         sum(f(6:10,1))/n, sum(f(6:10,2))/n, sum(f(6:10,3))/n,sum(f(6:10,4))/n;
         sum(f(11:15,1))/n, sum(f(11:15,2))/n, sum(f(11:15,3))/n,sum(f(11:15,4))/n]; 
prum7 = [sum(G(1:5,1))/n, sum(G(1:5,2))/n, sum(G(1:5,3))/n,sum(G(1:5,4))/n;
         sum(G(6:10,1))/n, sum(G(6:10,2))/n, sum(G(6:10,3))/n,sum(G(6:10,4))/n;
         sum(G(11:15,1))/n, sum(G(11:15,2))/n, sum(G(11:15,3))/n,sum(G(11:15,4))/n]; 
prum7a = [sum(g(1:5,1))/n, sum(g(1:5,2))/n, sum(g(1:5,3))/n,sum(g(1:5,4))/n;
         sum(g(6:10,1))/n, sum(g(6:10,2))/n, sum(g(6:10,3))/n,sum(g(6:10,4))/n;
         sum(g(11:15,1))/n, sum(g(11:15,2))/n, sum(g(11:15,3))/n,sum(g(11:15,4))/n]; 
prum8 = [sum(H(1:5,1))/n, sum(H(1:5,2))/n, sum(H(1:5,3))/n,sum(H(1:5,4))/n;
         sum(H(6:10,1))/n, sum(H(6:10,2))/n, sum(H(6:10,3))/n,sum(H(6:10,4))/n;
         sum(H(11:15,1))/n, sum(H(11:15,2))/n, sum(H(11:15,3))/n,sum(H(11:15,4))/n]; 
prum8a = [sum(h(1:5,1))/n, sum(h(1:5,2))/n, sum(h(1:5,3))/n,sum(h(1:5,4))/n;
         sum(h(6:10,1))/n, sum(h(6:10,2))/n, sum(h(6:10,3))/n,sum(h(6:10,4))/n;
         sum(h(11:15,1))/n, sum(h(11:15,2))/n, sum(h(11:15,3))/n,sum(h(11:15,4))/n]; 
prum9 = [sum(I(1:5,1))/n, sum(I(1:5,2))/n, sum(I(1:5,3))/n,sum(I(1:5,4))/n;
         sum(I(6:10,1))/n, sum(I(6:10,2))/n, sum(I(6:10,3))/n,sum(I(6:10,4))/n;
         sum(I(11:15,1))/n, sum(I(11:15,2))/n, sum(I(11:15,3))/n,sum(I(11:15,4))/n]; 
prum9a = [sum(i(1:5,1))/n, sum(i(1:5,2))/n, sum(i(1:5,3))/n,sum(i(1:5,4))/n;
         sum(i(6:10,1))/n, sum(i(6:10,2))/n, sum(i(6:10,3))/n,sum(i(6:10,4))/n;
         sum(i(11:15,1))/n, sum(i(11:15,2))/n, sum(i(11:15,3))/n,sum(i(11:15,4))/n]; 
prum10 = [sum(J(1:5,1))/n, sum(J(1:5,2))/n, sum(J(1:5,3))/n,sum(J(1:5,4))/n;
         sum(J(6:10,1))/n, sum(J(6:10,2))/n, sum(J(6:10,3))/n,sum(J(6:10,4))/n;
         sum(J(11:15,1))/n, sum(J(11:15,2))/n, sum(J(11:15,3))/n,sum(J(11:15,4))/n]; 
prum10a = [sum(j(1:5,1))/n, sum(j(1:5,2))/n, sum(j(1:5,3))/n,sum(j(1:5,4))/n;
         sum(j(6:10,1))/n, sum(j(6:10,2))/n, sum(j(6:10,3))/n,sum(j(6:10,4))/n;
         sum(j(11:15,1))/n, sum(j(11:15,2))/n, sum(j(11:15,3))/n,sum(j(11:15,4))/n]; 
prum11 = [sum(K(1:5,1))/n, sum(K(1:5,2))/n, sum(K(1:5,3))/n,sum(K(1:5,4))/n;
         sum(K(6:10,1))/n, sum(K(6:10,2))/n, sum(K(6:10,3))/n,sum(K(6:10,4))/n;
         sum(K(11:15,1))/n, sum(K(11:15,2))/n, sum(K(11:15,3))/n,sum(K(11:15,4))/n]; 
prum11a = [sum(k(1:5,1))/n, sum(k(1:5,2))/n, sum(k(1:5,3))/n,sum(k(1:5,4))/n;
         sum(k(6:10,1))/n, sum(k(6:10,2))/n, sum(k(6:10,3))/n,sum(k(6:10,4))/n;
         sum(k(11:15,1))/n, sum(k(11:15,2))/n, sum(k(11:15,3))/n,sum(k(11:15,4))/n];    
prum12 = [sum(L(1:5,1))/n, sum(L(1:5,2))/n, sum(L(1:5,3))/n,sum(L(1:5,4))/n;
         sum(L(6:10,1))/n, sum(L(6:10,2))/n, sum(L(6:10,3))/n,sum(L(6:10,4))/n;
         sum(L(11:15,1))/n, sum(L(11:15,2))/n, sum(L(11:15,3))/n,sum(L(11:15,4))/n]; 
prum12a = [sum(l(1:5,1))/n, sum(l(1:5,2))/n, sum(l(1:5,3))/n,sum(l(1:5,4))/n;
         sum(l(6:10,1))/n, sum(l(6:10,2))/n, sum(l(6:10,3))/n,sum(l(6:10,4))/n;
         sum(l(11:15,1))/n, sum(l(11:15,2))/n, sum(l(11:15,3))/n,sum(l(11:15,4))/n];    
prum13 = [sum(M(1:5,1))/n, sum(M(1:5,2))/n, sum(M(1:5,3))/n,sum(M(1:5,4))/n;
         sum(M(6:10,1))/n, sum(M(6:10,2))/n, sum(M(6:10,3))/n,sum(M(6:10,4))/n;
         sum(M(11:15,1))/n, sum(M(11:15,2))/n, sum(M(11:15,3))/n,sum(M(11:15,4))/n]; 
prum13a = [sum(m1(1:5,1))/n, sum(m1(1:5,2))/n, sum(m1(1:5,3))/n,sum(m1(1:5,4))/n;
         sum(m1(6:10,1))/n, sum(m1(6:10,2))/n, sum(m1(6:10,3))/n,sum(m1(6:10,4))/n;
         sum(m1(11:15,1))/n, sum(m1(11:15,2))/n, sum(m1(11:15,3))/n,sum(m1(11:15,4))/n];
prum14 = [sum(N(1:5,1))/n, sum(N(1:5,2))/n, sum(N(1:5,3))/n,sum(N(1:5,4))/n;
         sum(N(6:10,1))/n, sum(N(6:10,2))/n, sum(N(6:10,3))/n,sum(N(6:10,4))/n;
         sum(N(11:15,1))/n, sum(N(11:15,2))/n, sum(N(11:15,3))/n,sum(N(11:15,4))/n]; 
prum14a = [sum(n1(1:5,1))/n, sum(n1(1:5,2))/n, sum(n1(1:5,3))/n,sum(n1(1:5,4))/n;
         sum(n1(6:10,1))/n, sum(n1(6:10,2))/n, sum(n1(6:10,3))/n,sum(n1(6:10,4))/n;
         sum(n1(11:15,1))/n, sum(n1(11:15,2))/n, sum(n1(11:15,3))/n,sum(n1(11:15,4))/n]; 
prum15 = [sum(O(1:5,1))/n, sum(O(1:5,2))/n, sum(O(1:5,3))/n,sum(O(1:5,4))/n;
         sum(O(6:10,1))/n, sum(O(6:10,2))/n, sum(O(6:10,3))/n,sum(O(6:10,4))/n;
         sum(O(11:15,1))/n, sum(O(11:15,2))/n, sum(O(11:15,3))/n,sum(O(11:15,4))/n]; 
prum15a = [sum(o(1:5,1))/n, sum(o(1:5,2))/n, sum(o(1:5,3))/n,sum(o(1:5,4))/n;
         sum(o(6:10,1))/n, sum(o(6:10,2))/n, sum(o(6:10,3))/n,sum(o(6:10,4))/n;
         sum(o(11:15,1))/n, sum(o(11:15,2))/n, sum(o(11:15,3))/n,sum(o(11:15,4))/n];  
prum16 = [sum(P(1:5,1))/n, sum(P(1:5,2))/n, sum(P(1:5,3))/n,sum(P(1:5,4))/n;
         sum(P(6:10,1))/n, sum(P(6:10,2))/n, sum(P(6:10,3))/n,sum(P(6:10,4))/n;
         sum(P(11:15,1))/n, sum(P(11:15,2))/n, sum(P(11:15,3))/n,sum(P(11:15,4))/n]; 
prum16a = [sum(p(1:5,1))/n, sum(p(1:5,2))/n, sum(p(1:5,3))/n,sum(p(1:5,4))/n;
         sum(p(6:10,1))/n, sum(p(6:10,2))/n, sum(p(6:10,3))/n,sum(p(6:10,4))/n;
         sum(p(11:15,1))/n, sum(p(11:15,2))/n, sum(p(11:15,3))/n,sum(p(11:15,4))/n]; 
prum17 = [sum(Q(1:5,1))/n, sum(Q(1:5,2))/n, sum(Q(1:5,3))/n,sum(Q(1:5,4))/n;
         sum(Q(6:10,1))/n, sum(Q(6:10,2))/n, sum(Q(6:10,3))/n,sum(Q(6:10,4))/n;
         sum(Q(11:15,1))/n, sum(Q(11:15,2))/n, sum(Q(11:15,3))/n,sum(Q(11:15,4))/n]; 
prum17a = [sum(q(1:5,1))/n, sum(q(1:5,2))/n, sum(q(1:5,3))/n,sum(q(1:5,4))/n;
         sum(q(6:10,1))/n, sum(q(6:10,2))/n, sum(q(6:10,3))/n,sum(q(6:10,4))/n;
         sum(q(11:15,1))/n, sum(q(11:15,2))/n, sum(q(11:15,3))/n,sum(q(11:15,4))/n]; 
prum18 = [sum(R(1:5,1))/n, sum(R(1:5,2))/n, sum(R(1:5,3))/n,sum(R(1:5,4))/n;
         sum(R(6:10,1))/n, sum(R(6:10,2))/n, sum(R(6:10,3))/n,sum(R(6:10,4))/n;
         sum(R(11:15,1))/n, sum(R(11:15,2))/n, sum(R(11:15,3))/n,sum(R(11:15,4))/n]; 
prum18a = [sum(r(1:5,1))/n, sum(r(1:5,2))/n, sum(r(1:5,3))/n,sum(r(1:5,4))/n;
         sum(r(6:10,1))/n, sum(r(6:10,2))/n, sum(r(6:10,3))/n,sum(r(6:10,4))/n;
         sum(r(11:15,1))/n, sum(r(11:15,2))/n, sum(r(11:15,3))/n,sum(r(11:15,4))/n];    
prum19 = [sum(S(1:5,1))/n, sum(S(1:5,2))/n, sum(S(1:5,3))/n,sum(S(1:5,4))/n;
         sum(S(6:10,1))/n, sum(S(6:10,2))/n, sum(S(6:10,3))/n,sum(S(6:10,4))/n;
         sum(S(11:15,1))/n, sum(S(11:15,2))/n, sum(S(11:15,3))/n,sum(S(11:15,4))/n]; 
prum19a = [sum(s(1:5,1))/n, sum(s(1:5,2))/n, sum(s(1:5,3))/n,sum(s(1:5,4))/n;
         sum(s(6:10,1))/n, sum(s(6:10,2))/n, sum(s(6:10,3))/n,sum(s(6:10,4))/n;
         sum(s(11:15,1))/n, sum(s(11:15,2))/n, sum(s(11:15,3))/n,sum(s(11:15,4))/n];    
prum20 = [sum(T(1:5,1))/n, sum(T(1:5,2))/n, sum(T(1:5,3))/n,sum(T(1:5,4))/n;
         sum(T(6:10,1))/n, sum(T(6:10,2))/n, sum(T(6:10,3))/n,sum(T(6:10,4))/n;
         sum(T(11:15,1))/n, sum(T(11:15,2))/n, sum(T(11:15,3))/n,sum(T(11:15,4))/n]; 
prum20a = [sum(t(1:5,1))/n, sum(t(1:5,2))/n, sum(t(1:5,3))/n,sum(t(1:5,4))/n;
         sum(t(6:10,1))/n, sum(t(6:10,2))/n, sum(t(6:10,3))/n,sum(t(6:10,4))/n;
         sum(t(11:15,1))/n, sum(t(11:15,2))/n, sum(t(11:15,3))/n,sum(t(11:15,4))/n];    
prum21 = [sum(U(1:5,1))/n, sum(U(1:5,2))/n, sum(U(1:5,3))/n,sum(U(1:5,4))/n;
         sum(U(6:10,1))/n, sum(U(6:10,2))/n, sum(U(6:10,3))/n,sum(U(6:10,4))/n;
         sum(U(11:15,1))/n, sum(U(11:15,2))/n, sum(U(11:15,3))/n,sum(U(11:15,4))/n]; 
prum21a = [sum(u(1:5,1))/n, sum(u(1:5,2))/n, sum(u(1:5,3))/n,sum(u(1:5,4))/n;
         sum(u(6:10,1))/n, sum(u(6:10,2))/n, sum(u(6:10,3))/n,sum(u(6:10,4))/n;
         sum(u(11:15,1))/n, sum(u(11:15,2))/n, sum(u(11:15,3))/n,sum(u(11:15,4))/n];       
prum22 = [sum(V(1:5,1))/n, sum(V(1:5,2))/n, sum(V(1:5,3))/n,sum(V(1:5,4))/n;
         sum(V(6:10,1))/n, sum(V(6:10,2))/n, sum(V(6:10,3))/n,sum(V(6:10,4))/n;
         sum(V(11:15,1))/n, sum(V(11:15,2))/n, sum(V(11:15,3))/n,sum(V(11:15,4))/n]; 
prum22a = [sum(v(1:5,1))/n, sum(v(1:5,2))/n, sum(v(1:5,3))/n,sum(v(1:5,4))/n;
         sum(v(6:10,1))/n, sum(v(6:10,2))/n, sum(v(6:10,3))/n,sum(v(6:10,4))/n;
         sum(v(11:15,1))/n, sum(v(11:15,2))/n, sum(v(11:15,3))/n,sum(v(11:15,4))/n]; 
%% Výpoèet oprav
o1 =  [prum1(1,1)-A(1:5,1),prum1(1,2)-A(1:5,2),prum1(1,3)-A(1:5,3),prum1(1,4)-A(1:5,4);
       prum1(2,1)-A(6:10,1),prum1(2,2)-A(6:10,2),prum1(2,3)-A(6:10,3),prum1(2,4)-A(6:10,4);
       prum1(3,1)-A(11:15,1),prum1(3,2)-A(11:15,2),prum1(3,3)-A(11:15,3),prum1(3,4)-A(11:15,4)];
o1a = [prum1a(1,1)-a(1:5,1),prum1a(1,2)-a(1:5,2),prum1a(1,3)-a(1:5,3),prum1a(1,4)-a(1:5,4);
       prum1a(2,1)-a(6:10,1),prum1a(2,2)-a(6:10,2),prum1a(2,3)-a(6:10,3),prum1a(2,4)-a(6:10,4);
       prum1a(3,1)-a(11:15,1),prum1a(3,2)-a(11:15,2),prum1a(3,3)-a(11:15,3),prum1a(3,4)-a(11:15,4)];   
o2a = [prum2a(1,1)-b(1:5,1),prum2a(1,2)-b(1:5,2),prum2a(1,3)-b(1:5,3),prum2a(1,4)-b(1:5,4);
       prum2a(2,1)-b(6:10,1),prum2a(2,2)-b(6:10,2),prum2a(2,3)-b(6:10,3),prum2a(2,4)-b(6:10,4);
       prum2a(3,1)-b(11:15,1),prum2a(3,2)-b(11:15,2),prum2a(3,3)-b(11:15,3),prum2a(3,4)-b(11:15,4)];  
 o3 =  [prum3(1,1)-C(1:5,1),prum3(1,2)-C(1:5,2),prum3(1,3)-C(1:5,3),prum3(1,4)-C(1:5,4);
       prum3(2,1)-C(6:10,1),prum3(2,2)-C(6:10,2),prum3(2,3)-C(6:10,3),prum3(2,4)-C(6:10,4);
       prum3(3,1)-C(11:15,1),prum3(3,2)-C(11:15,2),prum3(3,3)-C(11:15,3),prum3(3,4)-C(11:15,4)];
o3a = [prum3a(1,1)-c(1:5,1),prum3a(1,2)-c(1:5,2),prum3a(1,3)-c(1:5,3),prum3a(1,4)-c(1:5,4);
       prum3a(2,1)-c(6:10,1),prum3a(2,2)-c(6:10,2),prum3a(2,3)-c(6:10,3),prum3a(2,4)-c(6:10,4);
       prum3a(3,1)-c(11:15,1),prum3a(3,2)-c(11:15,2),prum3a(3,3)-c(11:15,3),prum3a(3,4)-c(11:15,4)];  
o4 =  [prum4(1,1)-D(1:5,1),prum4(1,2)-D(1:5,2),prum4(1,3)-D(1:5,3),prum4(1,4)-D(1:5,4);
       prum4(2,1)-D(6:10,1),prum4(2,2)-D(6:10,2),prum4(2,3)-D(6:10,3),prum4(2,4)-D(6:10,4);
       prum4(3,1)-D(11:15,1),prum4(3,2)-D(11:15,2),prum4(3,3)-D(11:15,3),prum4(3,4)-D(11:15,4)];
o4a = [prum4a(1,1)-d(1:5,1),prum4a(1,2)-d(1:5,2),prum4a(1,3)-d(1:5,3),prum4a(1,4)-d(1:5,4);
       prum4a(2,1)-d(6:10,1),prum4a(2,2)-d(6:10,2),prum4a(2,3)-d(6:10,3),prum4a(2,4)-d(6:10,4);
       prum4a(3,1)-d(11:15,1),prum4a(3,2)-d(11:15,2),prum4a(3,3)-d(11:15,3),prum4a(3,4)-d(11:15,4)];    
o5 =  [prum5(1,1)-E(1:5,1),prum5(1,2)-E(1:5,2),prum5(1,3)-E(1:5,3),prum5(1,4)-E(1:5,4);
       prum5(2,1)-E(6:10,1),prum5(2,2)-E(6:10,2),prum5(2,3)-E(6:10,3),prum5(2,4)-E(6:10,4);
       prum5(3,1)-E(11:15,1),prum5(3,2)-E(11:15,2),prum5(3,3)-E(11:15,3),prum5(3,4)-E(11:15,4)];
o5a = [prum5a(1,1)-e(1:5,1),prum5a(1,2)-e(1:5,2),prum5a(1,3)-e(1:5,3),prum5a(1,4)-e(1:5,4);
       prum5a(2,1)-e(6:10,1),prum5a(2,2)-e(6:10,2),prum5a(2,3)-e(6:10,3),prum5a(2,4)-e(6:10,4);
       prum5a(3,1)-e(11:15,1),prum5a(3,2)-e(11:15,2),prum5a(3,3)-e(11:15,3),prum5a(3,4)-e(11:15,4)];     
o6 =  [prum6(1,1)-F(1:5,1),prum6(1,2)-F(1:5,2),prum6(1,3)-F(1:5,3),prum6(1,4)-F(1:5,4);
       prum6(2,1)-F(6:10,1),prum6(2,2)-F(6:10,2),prum6(2,3)-F(6:10,3),prum6(2,4)-F(6:10,4);
       prum6(3,1)-F(11:15,1),prum6(3,2)-F(11:15,2),prum6(3,3)-F(11:15,3),prum6(3,4)-F(11:15,4)];
o6a = [prum6a(1,1)-f(1:5,1),prum6a(1,2)-f(1:5,2),prum6a(1,3)-f(1:5,3),prum6a(1,4)-f(1:5,4);
       prum6a(2,1)-f(6:10,1),prum6a(2,2)-f(6:10,2),prum6a(2,3)-f(6:10,3),prum6a(2,4)-f(6:10,4);
       prum6a(3,1)-f(11:15,1),prum6a(3,2)-f(11:15,2),prum6a(3,3)-f(11:15,3),prum6a(3,4)-f(11:15,4)];      
o7 =  [prum7(1,1)-G(1:5,1),prum7(1,2)-G(1:5,2),prum7(1,3)-G(1:5,3),prum7(1,4)-G(1:5,4);
       prum7(2,1)-G(6:10,1),prum7(2,2)-G(6:10,2),prum7(2,3)-G(6:10,3),prum7(2,4)-G(6:10,4);
       prum7(3,1)-G(11:15,1),prum7(3,2)-G(11:15,2),prum7(3,3)-G(11:15,3),prum7(3,4)-G(11:15,4)];
o7a = [prum7a(1,1)-g(1:5,1),prum7a(1,2)-g(1:5,2),prum7a(1,3)-g(1:5,3),prum7a(1,4)-g(1:5,4);
       prum7a(2,1)-g(6:10,1),prum7a(2,2)-g(6:10,2),prum7a(2,3)-g(6:10,3),prum7a(2,4)-g(6:10,4);
       prum7a(3,1)-g(11:15,1),prum7a(3,2)-g(11:15,2),prum7a(3,3)-g(11:15,3),prum7a(3,4)-g(11:15,4)]; 
 o8 =  [prum8(1,1)-H(1:5,1),prum8(1,2)-H(1:5,2),prum8(1,3)-H(1:5,3),prum8(1,4)-H(1:5,4);
       prum8(2,1)-H(6:10,1),prum8(2,2)-H(6:10,2),prum8(2,3)-H(6:10,3),prum8(2,4)-H(6:10,4);
       prum8(3,1)-H(11:15,1),prum8(3,2)-H(11:15,2),prum8(3,3)-H(11:15,3),prum8(3,4)-H(11:15,4)];
o8a = [prum8a(1,1)-h(1:5,1),prum8a(1,2)-h(1:5,2),prum8a(1,3)-h(1:5,3),prum8a(1,4)-h(1:5,4);
       prum8a(2,1)-h(6:10,1),prum8a(2,2)-h(6:10,2),prum8a(2,3)-h(6:10,3),prum8a(2,4)-h(6:10,4);
       prum8a(3,1)-h(11:15,1),prum8a(3,2)-h(11:15,2),prum8a(3,3)-h(11:15,3),prum8a(3,4)-h(11:15,4)]; 
o9 =  [prum9(1,1)-I(1:5,1),prum9(1,2)-I(1:5,2),prum9(1,3)-I(1:5,3),prum9(1,4)-I(1:5,4);
       prum9(2,1)-I(6:10,1),prum9(2,2)-I(6:10,2),prum9(2,3)-I(6:10,3),prum9(2,4)-I(6:10,4);
       prum9(3,1)-I(11:15,1),prum9(3,2)-I(11:15,2),prum9(3,3)-I(11:15,3),prum9(3,4)-I(11:15,4)];
o9a = [prum9a(1,1)-i(1:5,1),prum9a(1,2)-i(1:5,2),prum9a(1,3)-i(1:5,3),prum9a(1,4)-i(1:5,4);
       prum9a(2,1)-i(6:10,1),prum9a(2,2)-i(6:10,2),prum9a(2,3)-i(6:10,3),prum9a(2,4)-i(6:10,4);
       prum9a(3,1)-i(11:15,1),prum9a(3,2)-i(11:15,2),prum9a(3,3)-i(11:15,3),prum9a(3,4)-i(11:15,4)];  
o10 =  [prum10(1,1)-J(1:5,1),prum10(1,2)-J(1:5,2),prum10(1,3)-J(1:5,3),prum10(1,4)-J(1:5,4);
       prum10(2,1)-J(6:10,1),prum10(2,2)-J(6:10,2),prum10(2,3)-J(6:10,3),prum10(2,4)-J(6:10,4);
       prum10(3,1)-J(11:15,1),prum10(3,2)-J(11:15,2),prum10(3,3)-J(11:15,3),prum10(3,4)-J(11:15,4)];
o10a = [prum10a(1,1)-j(1:5,1),prum10a(1,2)-j(1:5,2),prum10a(1,3)-j(1:5,3),prum10a(1,4)-j(1:5,4);
       prum10a(2,1)-j(6:10,1),prum10a(2,2)-j(6:10,2),prum10a(2,3)-j(6:10,3),prum10a(2,4)-j(6:10,4);
       prum10a(3,1)-j(11:15,1),prum10a(3,2)-j(11:15,2),prum10a(3,3)-j(11:15,3),prum10a(3,4)-j(11:15,4)];    
o11 =  [prum11(1,1)-K(1:5,1),prum11(1,2)-K(1:5,2),prum11(1,3)-K(1:5,3),prum11(1,4)-K(1:5,4);
       prum11(2,1)-K(6:10,1),prum11(2,2)-K(6:10,2),prum11(2,3)-K(6:10,3),prum11(2,4)-K(6:10,4);
       prum11(3,1)-K(11:15,1),prum11(3,2)-K(11:15,2),prum11(3,3)-K(11:15,3),prum11(3,4)-K(11:15,4)];
o11a = [prum11a(1,1)-k(1:5,1),prum11a(1,2)-k(1:5,2),prum11a(1,3)-k(1:5,3),prum11a(1,4)-k(1:5,4);
       prum11a(2,1)-k(6:10,1),prum11a(2,2)-k(6:10,2),prum11a(2,3)-k(6:10,3),prum11a(2,4)-k(6:10,4);
       prum11a(3,1)-k(11:15,1),prum11a(3,2)-k(11:15,2),prum11a(3,3)-k(11:15,3),prum11a(3,4)-k(11:15,4)];    
o12 =  [prum12(1,1)-L(1:5,1),prum12(1,2)-L(1:5,2),prum12(1,3)-L(1:5,3),prum12(1,4)-L(1:5,4);
       prum12(2,1)-L(6:10,1),prum12(2,2)-L(6:10,2),prum12(2,3)-L(6:10,3),prum12(2,4)-L(6:10,4);
       prum12(3,1)-L(11:15,1),prum12(3,2)-L(11:15,2),prum12(3,3)-L(11:15,3),prum12(3,4)-L(11:15,4)];
o12a = [prum12a(1,1)-l(1:5,1),prum12a(1,2)-l(1:5,2),prum12a(1,3)-l(1:5,3),prum12a(1,4)-l(1:5,4);
       prum12a(2,1)-l(6:10,1),prum12a(2,2)-l(6:10,2),prum12a(2,3)-l(6:10,3),prum12a(2,4)-l(6:10,4);
       prum12a(3,1)-l(11:15,1),prum12a(3,2)-l(11:15,2),prum12a(3,3)-l(11:15,3),prum12a(3,4)-l(11:15,4)];    
o13 =  [prum13(1,1)-M(1:5,1),prum13(1,2)-M(1:5,2),prum13(1,3)-M(1:5,3),prum13(1,4)-M(1:5,4);
       prum13(2,1)-M(6:10,1),prum13(2,2)-M(6:10,2),prum13(2,3)-M(6:10,3),prum13(2,4)-M(6:10,4);
       prum13(3,1)-M(11:15,1),prum13(3,2)-M(11:15,2),prum13(3,3)-M(11:15,3),prum13(3,4)-M(11:15,4)];
o13a = [prum13a(1,1)-m1(1:5,1),prum13a(1,2)-m1(1:5,2),prum13a(1,3)-m1(1:5,3),prum13a(1,4)-m1(1:5,4);
       prum13a(2,1)-m1(6:10,1),prum13a(2,2)-m1(6:10,2),prum13a(2,3)-m1(6:10,3),prum13a(2,4)-m1(6:10,4);
       prum13a(3,1)-m1(11:15,1),prum13a(3,2)-m1(11:15,2),prum13a(3,3)-m1(11:15,3),prum13a(3,4)-m1(11:15,4)];    
o14 =  [prum14(1,1)-N(1:5,1),prum14(1,2)-N(1:5,2),prum14(1,3)-N(1:5,3),prum14(1,4)-N(1:5,4);
       prum14(2,1)-N(6:10,1),prum14(2,2)-N(6:10,2),prum14(2,3)-N(6:10,3),prum14(2,4)-N(6:10,4);
       prum14(3,1)-N(11:15,1),prum14(3,2)-N(11:15,2),prum14(3,3)-N(11:15,3),prum14(3,4)-N(11:15,4)];
o14a = [prum14a(1,1)-n1(1:5,1),prum14a(1,2)-n1(1:5,2),prum14a(1,3)-n1(1:5,3),prum14a(1,4)-n1(1:5,4);
       prum14a(2,1)-n1(6:10,1),prum14a(2,2)-n1(6:10,2),prum14a(2,3)-n1(6:10,3),prum14a(2,4)-n1(6:10,4);
       prum14a(3,1)-n1(11:15,1),prum14a(3,2)-n1(11:15,2),prum14a(3,3)-n1(11:15,3),prum14a(3,4)-n1(11:15,4)];    
o15 =  [prum15(1,1)-O(1:5,1),prum15(1,2)-O(1:5,2),prum15(1,3)-O(1:5,3),prum15(1,4)-O(1:5,4);
       prum15(2,1)-O(6:10,1),prum15(2,2)-O(6:10,2),prum15(2,3)-O(6:10,3),prum15(2,4)-O(6:10,4);
       prum15(3,1)-O(11:15,1),prum15(3,2)-O(11:15,2),prum15(3,3)-O(11:15,3),prum15(3,4)-O(11:15,4)];
o15a = [prum15a(1,1)-o(1:5,1),prum15a(1,2)-o(1:5,2),prum15a(1,3)-o(1:5,3),prum15a(1,4)-o(1:5,4);
       prum15a(2,1)-o(6:10,1),prum15a(2,2)-o(6:10,2),prum15a(2,3)-o(6:10,3),prum15a(2,4)-o(6:10,4);
       prum15a(3,1)-o(11:15,1),prum15a(3,2)-o(11:15,2),prum15a(3,3)-o(11:15,3),prum15a(3,4)-o(11:15,4)];  
o16 =  [prum16(1,1)-P(1:5,1),prum16(1,2)-P(1:5,2),prum16(1,3)-P(1:5,3),prum16(1,4)-P(1:5,4);
       prum16(2,1)-P(6:10,1),prum16(2,2)-P(6:10,2),prum16(2,3)-P(6:10,3),prum16(2,4)-P(6:10,4);
       prum16(3,1)-P(11:15,1),prum16(3,2)-P(11:15,2),prum16(3,3)-P(11:15,3),prum16(3,4)-P(11:15,4)];
o16a = [prum16a(1,1)-p(1:5,1),prum16a(1,2)-p(1:5,2),prum16a(1,3)-p(1:5,3),prum16a(1,4)-p(1:5,4);
       prum16a(2,1)-p(6:10,1),prum16a(2,2)-p(6:10,2),prum16a(2,3)-p(6:10,3),prum16a(2,4)-p(6:10,4);
       prum16a(3,1)-p(11:15,1),prum16a(3,2)-p(11:15,2),prum16a(3,3)-p(11:15,3),prum16a(3,4)-p(11:15,4)];    
o17 =  [prum17(1,1)-Q(1:5,1),prum17(1,2)-Q(1:5,2),prum17(1,3)-Q(1:5,3),prum17(1,4)-Q(1:5,4);
       prum17(2,1)-Q(6:10,1),prum17(2,2)-Q(6:10,2),prum17(2,3)-Q(6:10,3),prum17(2,4)-Q(6:10,4);
       prum17(3,1)-Q(11:15,1),prum17(3,2)-Q(11:15,2),prum17(3,3)-Q(11:15,3),prum17(3,4)-Q(11:15,4)];
o17a = [prum17a(1,1)-q(1:5,1),prum17a(1,2)-q(1:5,2),prum17a(1,3)-q(1:5,3),prum17a(1,4)-q(1:5,4);
       prum17a(2,1)-q(6:10,1),prum17a(2,2)-q(6:10,2),prum17a(2,3)-q(6:10,3),prum17a(2,4)-q(6:10,4);
       prum17a(3,1)-q(11:15,1),prum17a(3,2)-q(11:15,2),prum17a(3,3)-q(11:15,3),prum17a(3,4)-q(11:15,4)]; 
o18 =  [prum18(1,1)-R(1:5,1),prum18(1,2)-R(1:5,2),prum18(1,3)-R(1:5,3),prum18(1,4)-R(1:5,4);
       prum18(2,1)-R(6:10,1),prum18(2,2)-R(6:10,2),prum18(2,3)-R(6:10,3),prum18(2,4)-R(6:10,4);
       prum18(3,1)-R(11:15,1),prum18(3,2)-R(11:15,2),prum18(3,3)-R(11:15,3),prum18(3,4)-R(11:15,4)];
o18a = [prum18a(1,1)-r(1:5,1),prum18a(1,2)-r(1:5,2),prum18a(1,3)-r(1:5,3),prum18a(1,4)-r(1:5,4);
       prum18a(2,1)-r(6:10,1),prum18a(2,2)-r(6:10,2),prum18a(2,3)-r(6:10,3),prum18a(2,4)-r(6:10,4);
       prum18a(3,1)-r(11:15,1),prum18a(3,2)-r(11:15,2),prum18a(3,3)-r(11:15,3),prum18a(3,4)-r(11:15,4)];  
o19 =  [prum19(1,1)-S(1:5,1),prum19(1,2)-S(1:5,2),prum19(1,3)-S(1:5,3),prum19(1,4)-S(1:5,4);
       prum19(2,1)-S(6:10,1),prum19(2,2)-S(6:10,2),prum19(2,3)-S(6:10,3),prum19(2,4)-S(6:10,4);
       prum19(3,1)-S(11:15,1),prum19(3,2)-S(11:15,2),prum19(3,3)-S(11:15,3),prum19(3,4)-S(11:15,4)];
o19a = [prum19a(1,1)-s(1:5,1),prum19a(1,2)-s(1:5,2),prum19a(1,3)-s(1:5,3),prum19a(1,4)-s(1:5,4);
       prum19a(2,1)-s(6:10,1),prum19a(2,2)-s(6:10,2),prum19a(2,3)-s(6:10,3),prum19a(2,4)-s(6:10,4);
       prum19a(3,1)-s(11:15,1),prum19a(3,2)-s(11:15,2),prum19a(3,3)-s(11:15,3),prum19a(3,4)-s(11:15,4)];    
o20 =  [prum20(1,1)-T(1:5,1),prum20(1,2)-T(1:5,2),prum20(1,3)-T(1:5,3),prum20(1,4)-T(1:5,4);
       prum20(2,1)-T(6:10,1),prum20(2,2)-T(6:10,2),prum20(2,3)-T(6:10,3),prum20(2,4)-T(6:10,4);
       prum20(3,1)-T(11:15,1),prum20(3,2)-T(11:15,2),prum20(3,3)-T(11:15,3),prum20(3,4)-T(11:15,4)];
o20a = [prum20a(1,1)-t(1:5,1),prum20a(1,2)-t(1:5,2),prum20a(1,3)-t(1:5,3),prum20a(1,4)-t(1:5,4);
       prum20a(2,1)-t(6:10,1),prum20a(2,2)-t(6:10,2),prum20a(2,3)-t(6:10,3),prum20a(2,4)-t(6:10,4);
       prum20a(3,1)-t(11:15,1),prum20a(3,2)-t(11:15,2),prum20a(3,3)-t(11:15,3),prum20a(3,4)-t(11:15,4)];    
o21 =  [prum21(1,1)-U(1:5,1),prum21(1,2)-U(1:5,2),prum21(1,3)-U(1:5,3),prum21(1,4)-U(1:5,4);
       prum21(2,1)-U(6:10,1),prum21(2,2)-U(6:10,2),prum21(2,3)-U(6:10,3),prum21(2,4)-U(6:10,4);
       prum21(3,1)-U(11:15,1),prum21(3,2)-U(11:15,2),prum21(3,3)-U(11:15,3),prum21(3,4)-U(11:15,4)];
o21a = [prum21a(1,1)-u(1:5,1),prum21a(1,2)-u(1:5,2),prum21a(1,3)-u(1:5,3),prum21a(1,4)-u(1:5,4);
       prum21a(2,1)-u(6:10,1),prum21a(2,2)-u(6:10,2),prum21a(2,3)-u(6:10,3),prum21a(2,4)-u(6:10,4);
       prum21a(3,1)-u(11:15,1),prum21a(3,2)-u(11:15,2),prum21a(3,3)-u(11:15,3),prum21a(3,4)-u(11:15,4)];    
o22 =  [prum22(1,1)-V(1:5,1),prum22(1,2)-V(1:5,2),prum22(1,3)-V(1:5,3),prum22(1,4)-V(1:5,4);
       prum22(2,1)-V(6:10,1),prum22(2,2)-V(6:10,2),prum22(2,3)-V(6:10,3),prum22(2,4)-V(6:10,4);
       prum22(3,1)-V(11:15,1),prum22(3,2)-V(11:15,2),prum22(3,3)-V(11:15,3),prum22(3,4)-V(11:15,4)];
o22a = [prum22a(1,1)-v(1:5,1),prum22a(1,2)-v(1:5,2),prum22a(1,3)-v(1:5,3),prum22a(1,4)-v(1:5,4);
       prum22a(2,1)-v(6:10,1),prum22a(2,2)-v(6:10,2),prum22a(2,3)-v(6:10,3),prum22a(2,4)-v(6:10,4);
       prum22a(3,1)-v(11:15,1),prum22a(3,2)-v(11:15,2),prum22a(3,3)-v(11:15,3),prum22a(3,4)-v(11:15,4)];    
%% Výpoèet smìrodatných odchylek opakovaného mìøení
sm_od1 = [(sqrt((sum(o1(1:5,1)))/(n-1))),(sqrt((sum(o1(1:5,2)))/(n-1))),(sqrt((sum(o1(1:5,3)))/(n-1))),(sqrt((sum(o1(1:5,4)))/(n-1)));
          (sqrt((sum(o1(6:10,1)))/(n-1))),(sqrt((sum(o1(6:10,2)))/(n-1))),(sqrt((sum(o1(6:10,3)))/(n-1))),(sqrt((sum(o1(6:10,4)))/(n-1)));
          (sqrt((sum(o1(11:15,1)))/(n-1))),(sqrt((sum(o1(11:15,2)))/(n-1))),(sqrt((sum(o1(11:15,3)))/(n-1))),(sqrt((sum(o1(11:15,4)))/(n-1)))];
sm_od1a = [(sqrt((sum(o1a(1:5,1)))/(n-1))),(sqrt((sum(o1a(1:5,2)))/(n-1))),(sqrt((sum(o1a(1:5,3)))/(n-1))),(sqrt((sum(o1a(1:5,4)))/(n-1)));
          (sqrt((sum(o1a(6:10,1)))/(n-1))),(sqrt((sum(o1a(6:10,2)))/(n-1))),(sqrt((sum(o1a(6:10,3)))/(n-1))),(sqrt((sum(o1a(6:10,4)))/(n-1)));
          (sqrt((sum(o1a(11:15,1)))/(n-1))),(sqrt((sum(o1a(11:15,2)))/(n-1))),(sqrt((sum(o1a(11:15,3)))/(n-1))),(sqrt((sum(o1a(11:15,4)))/(n-1)))];   
%jelikož z opakovaného mìøení by vypadalo mìøení jako absolutnì pøesné volím postup výpoètu pøesnosti dle rozdílu mezi vzdáleností mìøenou totální stanicí
%rozdíly prùmìrných vzdáleností mìøených totální stanicí
deltaT = [mean(A(16,:))-mean(a(16,:));mean(A(16,:))-mean(B(16,:)); mean(A(16,:))-mean(b(16,:));mean(A(16,:))-mean(C(16,:));mean(A(16,:))-mean(c(16,:));mean(A(16,:))-mean(D(16,:));...
         mean(A(16,:))-mean(d(16,:));mean(A(16,:))-mean(E(16,:));mean(A(16,:))-mean(e(16,:));mean(A(16,:))-mean(F(16,:));mean(A(16,:))-mean(f(16,:));mean(A(16,:))-mean(G(16,:));...
         mean(A(16,:))-mean(g(16,:));mean(A(16,:))-mean(H(16,:));mean(A(16,:))-mean(h(16,:));mean(A(16,:))-mean(I(16,:));mean(A(16,:))-mean(i(16,:));mean(A(16,:))-mean(J(16,:));...
         mean(A(16,:))-mean(j(16,:));mean(A(16,:))-mean(K(16,:));mean(A(16,:))-mean(k(16,:));mean(A(16,:))-mean(L(16,:));mean(A(16,:))-mean(l(16,:));mean(A(16,:))-mean(M(16,:));...
         mean(A(16,:))-mean(m1(16,:));mean(A(16,:))-mean(N(16,:));mean(A(16,:))-mean(n1(16,:));mean(A(16,:))-mean(O(16,:));mean(A(16,:))-mean(o(16,:));mean(A(16,:))-mean(P(16,:));...
         mean(A(16,:))-mean(p(16,:));mean(A(16,:))-mean(Q(16,:));mean(A(16,:))-mean(q(16,:));mean(A(16,:))-mean(R(16,:));mean(A(16,:))-mean(r(16,:));mean(A(16,:))-mean(S(16,:));...
         mean(A(16,:))-mean(s(16,:));mean(A(16,:))-mean(T(16,:));mean(A(16,:))-mean(t(16,:));mean(A(16,:))-mean(U(16,:));mean(A(16,:))-mean(u(16,:));mean(A(16,:))-mean(V(16,:));...
         mean(A(16,:))-mean(v(16,:))];
%rozdíly prùmìrù vzdáleností mìøených senzory
delta = [mean(prum1(1,:))-mean(prum1a(1,:)), mean(prum1(2,:))-mean(prum1a(2,:)),mean(prum1(3,:))-mean(prum1a(3,:));
         mean(prum1(1,:))-mean(prum2(1,:)),  mean(prum1(2,:))-mean(prum2(2,:)), mean(prum1(3,:))-mean(prum2(3,:));
         mean(prum1(1,:))-mean(prum2a(1,:)), mean(prum1(2,:))-mean(prum2a(2,:)),mean(prum1(3,:))-mean(prum2a(3,:));
         mean(prum1(1,:))-mean(prum3(1,:)),  mean(prum1(2,:))-mean(prum3(2,:)), mean(prum1(3,:))-mean(prum3(3,:));
         mean(prum1(1,:))-mean(prum3a(1,:)), mean(prum1(2,:))-mean(prum3a(2,:)),mean(prum1(3,:))-mean(prum3a(3,:));
         mean(prum1(1,:))-mean(prum4(1,:)),  mean(prum1(2,:))-mean(prum4(2,:)), mean(prum1(3,:))-mean(prum4(3,:));
         mean(prum1(1,:))-mean(prum4a(1,:)), mean(prum1(2,:))-mean(prum4a(2,:)),mean(prum1(3,:))-mean(prum4a(3,:));
         mean(prum1(1,:))-mean(prum5(1,:)),  mean(prum1(2,:))-mean(prum5(2,:)), mean(prum1(3,:))-mean(prum5(3,:));
         mean(prum1(1,:))-mean(prum5a(1,:)), mean(prum1(2,:))-mean(prum5a(2,:)),mean(prum1(3,:))-mean(prum5a(3,:));
         mean(prum1(1,:))-mean(prum6(1,:)),  mean(prum1(2,:))-mean(prum6(2,:)), mean(prum1(3,:))-mean(prum6(3,:));
         mean(prum1(1,:))-mean(prum6a(1,:)), mean(prum1(2,:))-mean(prum6a(2,:)),mean(prum1(3,:))-mean(prum6a(3,:));
         mean(prum1(1,:))-mean(prum7(1,:)),  mean(prum1(2,:))-mean(prum7(2,:)), mean(prum1(3,:))-mean(prum7(3,:));
         mean(prum1(1,:))-mean(prum7a(1,:)), mean(prum1(2,:))-mean(prum7a(2,:)),mean(prum1(3,:))-mean(prum7a(3,:));
         mean(prum1(1,:))-mean(prum8(1,:)),  mean(prum1(2,:))-mean(prum8(2,:)), mean(prum1(3,:))-mean(prum8(3,:));
         mean(prum1(1,:))-mean(prum8a(1,:)), mean(prum1(2,:))-mean(prum8a(2,:)),mean(prum1(3,:))-mean(prum8a(3,:));
         mean(prum1(1,:))-mean(prum9(1,:)),  mean(prum1(2,:))-mean(prum9(2,:)), mean(prum1(3,:))-mean(prum9(3,:));
         mean(prum1(1,:))-mean(prum9a(1,:)), mean(prum1(2,:))-mean(prum9a(2,:)),mean(prum1(3,:))-mean(prum9a(3,:));
         mean(prum1(1,:))-mean(prum10(1,:)), mean(prum1(2,:))-mean(prum10(2,:)),mean(prum1(3,:))-mean(prum10(3,:));
         mean(prum1(1,:))-mean(prum10a(1,:)), mean(prum1(2,:))-mean(prum10a(2,:)),mean(prum1(3,:))-mean(prum10a(3,:));
         mean(prum1(1,:))-mean(prum11(1,:)),  mean(prum1(2,:))-mean(prum11(2,:)), mean(prum1(3,:))-mean(prum11(3,:));
         mean(prum1(1,:))-mean(prum11a(1,:)), mean(prum1(2,:))-mean(prum11a(2,:)),mean(prum1(3,:))-mean(prum11a(3,:));
         mean(prum1(1,:))-mean(prum12(1,:)),  mean(prum1(2,:))-mean(prum12(2,:)), mean(prum1(3,:))-mean(prum12(3,:));
         mean(prum1(1,:))-mean(prum12a(1,:)), mean(prum1(2,:))-mean(prum12a(2,:)),mean(prum1(3,:))-mean(prum12a(3,:));
         mean(prum1(1,:))-mean(prum13(1,:)),  mean(prum1(2,:))-mean(prum13(2,:)), mean(prum1(3,:))-mean(prum13(3,:));
         mean(prum1(1,:))-mean(prum13a(1,:)), mean(prum1(2,:))-mean(prum13a(2,:)),mean(prum1(3,:))-mean(prum13a(3,:));
         mean(prum1(1,:))-mean(prum14(1,:)),  mean(prum1(2,:))-mean(prum14(2,:)), mean(prum1(3,:))-mean(prum14(3,:));
         mean(prum1(1,:))-mean(prum14a(1,:)), mean(prum1(2,:))-mean(prum14a(2,:)),mean(prum1(3,:))-mean(prum14a(3,:));
         mean(prum1(1,:))-mean(prum15(1,:)),  mean(prum1(2,:))-mean(prum15(2,:)), mean(prum1(3,:))-mean(prum15(3,:));
         mean(prum1(1,:))-mean(prum15a(1,:)), mean(prum1(2,:))-mean(prum15a(2,:)),mean(prum1(3,:))-mean(prum15a(3,:));
         mean(prum1(1,:))-mean(prum16(1,:)),  mean(prum1(2,:))-mean(prum16(2,:)), mean(prum1(3,:))-mean(prum16(3,:));
         mean(prum1(1,:))-mean(prum16a(1,:)), mean(prum1(2,:))-mean(prum16a(2,:)),mean(prum1(3,:))-mean(prum16a(3,:));
         mean(prum1(1,:))-mean(prum17(1,:)),  mean(prum1(2,:))-mean(prum17(2,:)), mean(prum1(3,:))-mean(prum17(3,:));
         mean(prum1(1,:))-mean(prum17a(1,:)), mean(prum1(2,:))-mean(prum17a(2,:)),mean(prum1(3,:))-mean(prum17a(3,:));
         mean(prum1(1,:))-mean(prum18(1,:)),  mean(prum1(2,:))-mean(prum18(2,:)), mean(prum1(3,:))-mean(prum18(3,:));
         mean(prum1(1,:))-mean(prum18a(1,:)), mean(prum1(2,:))-mean(prum18a(2,:)),mean(prum1(3,:))-mean(prum18a(3,:));
         mean(prum1(1,:))-mean(prum19(1,:)),  mean(prum1(2,:))-mean(prum19(2,:)), mean(prum1(3,:))-mean(prum19(3,:));
         mean(prum1(1,:))-mean(prum19a(1,:)), mean(prum1(2,:))-mean(prum19a(2,:)),mean(prum1(3,:))-mean(prum19a(3,:));
         mean(prum1(1,:))-mean(prum20(1,:)),  mean(prum1(2,:))-mean(prum20(2,:)), mean(prum1(3,:))-mean(prum20(3,:));
         mean(prum1(1,:))-mean(prum20a(1,:)), mean(prum1(2,:))-mean(prum20a(2,:)),mean(prum1(3,:))-mean(prum20a(3,:));
         mean(prum1(1,:))-mean(prum21(1,:)),  mean(prum1(2,:))-mean(prum21(2,:)), mean(prum1(3,:))-mean(prum21(3,:));
         mean(prum1(1,:))-mean(prum21a(1,:)), mean(prum1(2,:))-mean(prum21a(2,:)),mean(prum1(3,:))-mean(prum21a(3,:));
         mean(prum1(1,:))-mean(prum22(1,:)),  mean(prum1(2,:))-mean(prum22(2,:)), mean(prum1(3,:))-mean(prum22(3,:));
         mean(prum1(1,:))-mean(prum22a(1,:)), mean(prum1(2,:))-mean(prum22a(2,:)),mean(prum1(3,:))-mean(prum22a(3,:))];
   %výpoèet oprav
   Opravy = [deltaT+delta(:,1), deltaT+delta(:,2), deltaT+delta(:,3)];
sm_odchylky = [sqrt((sum(Opravy(:,1).^2))/(m*(n-1))),sqrt((sum(Opravy(:,2).^2))/(m*(n-1))),sqrt((sum(Opravy(:,3).^2))/(m*(n-1)))]
   
   
   
   
   
   





