Skip to main content
1-Visitor
September 24, 2015
Question

Find minimum non zero value in a matrix

  • September 24, 2015
  • 4 replies
  • 2632 views

Hi, is there an easy way to find the non zero minimum in a matrix?

Or is a loop the only way to do it?

This is what i have at the moment.

nonzeromin.png

4 replies

23-Emerald V
September 24, 2015

Oliver Guest wrote:

Hi, is there an easy way to find the non zero minimum in a matrix?

Or is a loop the only way to do it?

This is what i have at the moment.

Try this ..

Stuart

1-Visitor
September 24, 2015

Maybe a user defined function could work for you.

Mike

oguest1-VisitorAuthor
1-Visitor
October 2, 2015

Thanks for the suggestions guys. I realized that I needed to have a tolerance in there as some of my values were very close to zero. So I went for this:

minNZ.png

23-Emerald V
October 2, 2015

Hi Oliver,

Is b guaranteed to be  non zero or an in-tolerance X to never be negative?

Stuart

oguest1-VisitorAuthor
1-Visitor
October 2, 2015

Hi Stuart,

Yes for this particular task it wont ever be negative or exactly zero.

Oliver