% algandmed
% meil on vaja 4800 m3 liiva, 5800m3 peenet kruusa ja 5700m3 jämedat kruusa
clear
format short g
A=[0.52,0.2,0.25;0.3,0.5,0.2;0.18,0.3,0.55];
B=[4800;5800;5700];
X=linsolve(A,B); %lahenda X*A=B
karjaarist_1_tuua=X(1)
karjaarist_2_tuua=X(2)
karjaarist_3_tuua=X(3)
algandmete_kogus=sum(B)
kontroll_1=sum(X)
kontroll_2=X(1)*A(1,1)+X(2)*A(1,2)+X(3)*A(1,3)
kontroll_3=X(1)*A(2,1)+X(2)*A(2,2)+X(3)*A(2,3)
kontroll_4=X(1)*A(3,1)+X(2)*A(3,2)+X(3)*A(3,3)

