# How can I substitute all zeros of a matrix with minimum value of the same matrix?

1 view (last 30 days)

Show older comments

How can I substitute all zeros of a matrix with minimum value of the same matrix?

##### 2 Comments

Stephen23
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?

### Accepted Answer

Purushottama Rao
on 3 Sep 2015

a(a==0)=min(a(a~=0))

##### 3 Comments

Star Strider
on 3 Sep 2015

### More Answers (0)

### See Also

### Categories

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!