Skip to content

Instantly share code, notes, and snippets.

@vincentchu
Created February 7, 2009 02:02
Show Gist options
  • Save vincentchu/59729 to your computer and use it in GitHub Desktop.
Save vincentchu/59729 to your computer and use it in GitHub Desktop.
function writePDB(pdbFile, coords, origin, delta);
n = size(coords, 1);
inds = [1:n]';
coords = coords .* repmat(delta, n, 1) + repmat(origin, n, 1);
foo = [inds coords];
fid = fopen(pdbFile, 'w');
fprintf(fid, 'ATOM %6d ION XXXX 1 %7.3f %7.3f %7.3f\n', foo');
fclose(fid);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment