# I i i i

3 views (last 30 days)
Et on 3 Sep 2015
Commented: Stephen Cobeldick on 14 Jun 2020
This question was flagged by Walter Roberson
i i i i ?

#### 1 Comment

Stephen Cobeldick on 14 Jun 2020
Original question by Hamed Absharii 3rd September 2015, retrieved from Google Cache:
"How can I substitute all zeros of a matrix with minimum value of the same matrix?"
How can I substitute all zeros of a matrix with minimum value of the same matrix?

Purushottama Rao on 3 Sep 2015
` a(a==0)=min(a(a~=0))`

Purushottama Rao on 3 Sep 2015
```a=[0 1 2 3; 2 4 6 0]
```
```a =
```
```       0     1     2     3
2     4     6     0```
```>> a(a==0)=min(a(a~=0))
```
```a =
```
```       1     1     2     3
2     4     6     1```
Star Strider on 3 Sep 2015
@Purushottama Rao — Don’t worry about the ‘spam’ flag. It happens to us all. You correctly flagged it so someone would have discovered it when they checked the ‘Flagged Content’. I cleared them and cleared your flags as well.
Purushottama Rao on 3 Sep 2015
@Star Strider: Thank you