You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
% add hydrogen bonds to bond matrix. 12/04/09function [bond,C] = addhydrogenbonds(bond,C,R,atoms,allowed)
H = find(atoms==1); % H atoms
O = find(atoms==8); % O atoms
[Oi,Hi] = find(~C(O,H) & R(O,H)<2.0);
% find O-H shorted than 2 angstromsif isempty(Hi), return, end
H = H(Hi); % bonded H atoms
O = O(Oi); % bonded H atomsfor i =1:length(H)
if any(atoms(bond(H(i),:))==8) % if H covalently bonded to O
bond(O(i),H(i)) =true; % make hydrogen bond
bond(H(i),O(i)) =true;
endend
bond = onlyallowed(bond,allowed,atoms,R);
C = conn(bond);
end
The text was updated successfully, but these errors were encountered:
The original matlab code:
The text was updated successfully, but these errors were encountered: