For example

I have the matrix

`A= [1 3 4 7 3; 5 4 3 7 2; 9 8 6 5 2; 9 6 3 1 6; 2 9 6 8 5]`

My current position is at A(3,3) which is equal to 6. How do I make a loop that will pick out the minimum adjacent values of 6 which are [7 5 1]

## Best Answer