From: Jack Branning on
Does anyone know how I can find out what position a particular entry in a matrix is at, according to its coordinates?

For example, I know that the value is in A(2,3), but I need to know what position number in the matrix this is (i.e. position 23).

Thanks!

Jack
From: Andy on
"Jack Branning" <jbr.nospam(a)nospam.com> wrote in message <i2c779$aru$1(a)fred.mathworks.com>...
> Does anyone know how I can find out what position a particular entry in a matrix is at, according to its coordinates?
>
> For example, I know that the value is in A(2,3), but I need to know what position number in the matrix this is (i.e. position 23).
>
> Thanks!
>
> Jack

doc sub2ind
From: Yi Cao on
"Jack Branning" <jbr.nospam(a)nospam.com> wrote in message <i2c779$aru$1(a)fred.mathworks.com>...
> Does anyone know how I can find out what position a particular entry in a matrix is at, according to its coordinates?
>
> For example, I know that the value is in A(2,3), but I need to know what position number in the matrix this is (i.e. position 23).
>
> Thanks!
>
> Jack

Try 'help sub2ind'

HTH
Yi
From: Jack Branning on
Perfect, that's exactly the function I needed!

Thanks!
 | 
Pages: 1
Prev: Sort cell array
Next: Regexp IF statement