function [out]=riordinaInout(node)
OrderInout=zeros(length(node.out),length(node.in));
OrderInoutPeso=zeros(length(node.out),length(node.in));
SortedOut=sort([node.out]);

for i=1:length(node.out)
        
    [FoundElementsRow FoundElementsCol] =find(node.inout == SortedOut(i));
   for j=1:length(FoundElementsCol)
    OrderInout(i,FoundElementsCol(j))=(node.inout(FoundElementsRow(j),FoundElementsCol(j)));
    OrderInoutPeso(i,FoundElementsCol(j))=(node.inoutPeso(FoundElementsRow(j),FoundElementsCol(j)));
   end    

end   

out=node;
out.inout=OrderInout;
out.inoutPeso=OrderInoutPeso;

