Distance between residues
- To: mathgroup at smc.vnet.net
- Subject: [mg41288] Distance between residues
- From: rchoy at ula.ve
- Date: Tue, 13 May 2003 04:19:36 -0400 (EDT)
- Reply-to: rchoy at ula.ve
- Sender: owner-wri-mathgroup at wolfram.com
Hi, I'm trying to calculate the euclidean distances between elements of a matrix, for example: d=Sqrt[(x[i]-x[j])^2+(y[i]-y[j])^2], (and i is the element [[1,1]] and j is the element [[1,2]], as an example). Also the code in Mathematica (that i have) would be: d=Sqrt[(m[[i,1]]+m[[k,1]])^2+(m[[i,2]]+m[[k,2]])^2]. I have tried with Do, For, Table and While, but I haven't been able to do this (in a iterative way), any ideas? Thanks a lot, Rebeca