Index: mttroot/mtt/bin/trans/m/rbg2abg.m ================================================================== --- mttroot/mtt/bin/trans/m/rbg2abg.m +++ mttroot/mtt/bin/trans/m/rbg2abg.m @@ -3,10 +3,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.5 1996/08/24 19:21:26 peter +% %% More specific error messages. +% %% % %% Revision 1.4 1996/08/24 18:00:33 peter % %% Fixed bug with finding ports. % %% % %% Revision 1.3 1996/08/09 08:26:35 peter % %% Cosmetic tidy up. @@ -96,20 +99,23 @@ k=0; for j = 1:n b = bond_list(j); e = bond_end(j); % Find all ports on this bond [port_indices,m] = getindex(port_near_bond(:,1),b); - % Now find the one at this end + % Now find the one at this end - if any + port_index = 0; for l=1:m - port_index = port_indices(l); - if port_near_bond(port_index,2)==e + if port_near_bond(port_indices(l),2)==e + port_index = port_indices(l); break; end; end; - % and put the corresponding number in the list - k=k+1; - port_number(k,1) = port_near_bond(port_index,3); + if port_index>0 + % and put the corresponding number in the list + k=k+1; + port_number(k,1) = port_near_bond(port_index,3); + end; end; % Must have a lable for each port or non at all if k==n [sorted,sort_index]=sort(port_number);