Toto je starší verze dokumentu!
% % Function which solves Ax = b system of equations using QR decomposition % % Author: Martin Vejmelka <[email protected]> % function [ x ] = get_solution( A, b ) % determining solution size asize = size(A); result_vector_size = asize(2); % QR decomposition [Q1, R] = qr(A, 0); % vector being counted x = zeros(result_vector_size, 1); % right side b2 = Q1' * b; % iterating through values in x and counting x for i = result_vector_size:-1:1 x(i) = (b2(i) - (R(i,:) * x)) / R(i, i); end end