If I generated a random 5-by-5 matrix using the code r = rand(5)
.
I would like to find the location of the max value and replace this value by 10
, and the min value and replace the value by -10
.
How can I do it?
i tried to do the following:
r=rand(5)
find(max(max(r)))
Will this line give me the correct location of max value? And if it was correct now how can I replace the value by 10
?