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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! 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