Hi, Suppose I have the following:
r = rand(5, 5) I can select a single element of the array r using r[3, 4] Now suppose that I have the position [3, 4] stored in a variable as pos = [3, 4] How can I use pos as the index for selecting the *single* element r[3, 4]? I would like to do r[pos], but this returns a *two*-element array, given by the elements numbered 3 and 4 in the linear ordering of the array r. This sounds like a silly question, but I can't find the answer! Thanks, David.