I\'m use the following code:
function[xbase]=BasicSolution(A, b, B) [m,n]=size(A); for i=1:m xbase(i)=b(i)/A(i,B(i)); end endfunction