cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Find minimum non zero value in a matrix

oguest
1-Visitor

Find minimum non zero value in a matrix

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

5 REPLIES 5
StuartBruff
23-Emerald III
(To:oguest)

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

Maybe a user defined function could work for you.

Mike

oguest
1-Visitor
(To:oguest)

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

StuartBruff
23-Emerald III
(To:oguest)

Hi Oliver,

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

Stuart

oguest
1-Visitor
(To:oguest)

Hi Stuart,

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

Oliver

Announcements

Top Tags