function C = vynasob(A,B)
[ra,ca] = size(A);
[rb,cb] = size(B);

if (ca ~= rb)
    disp('spatne rozmery');
    return
end

C = zeros(ra,cb);
for i = 1:ra
    for j = 1:cb
        for k = 1:ca
            C(i,j) = C(i,j) + A(i,k)*B(k,j);
        end
    end
end
end
