I have an array in matlab, e.g.
a=rand([3,3])
a =
0.8308 0.9172 0.7537
0.5853 0.2858 0.3804
0.5497 0.7572 0.5678
And now, I would like to set the min value of each row to 0. The result should be:
a =
0.8308 0.9172 0
0.5853 0 0.3804
0 0.7572 0.5678
I have no idea how to use [Y,I]=min(a,[],2) function for this. Thanks.