From 11:00 PM CST Friday, Feb 14th - 6:30 PM CST Saturday, Feb 15th, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
DancingDeveloper

Compound Arithmetic Function - "Greatest" and "Least"

Status: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.

It'd be nice to have a compound arithmetic function of "Greatest" and "Least" which will output the largest or smallest of the input values. It could look like this but with re-sizable input nodes. 

 

Also, I think the top way is the best way to find the greatest in a set, but let me know if there is a better way. 

5 Comments
AristosQueue (NI)
NI Employee (retired)

Either of these work for you?

Untitled.png

Calling Array Max & Min is way more efficient than sorting the array. Finding the max is a linear operation. Sorting is O(n log n).

 

The Min & Max is not growable, which is what you requested, so it isn't a direct answer to your ask, but it's closer than your current workarounds.

wiebe@CARYA
Knight of NI

There is a subtle difference between Array Max & Min and Max & Min. Max & Min will return the min and max of the individual elements, where Array Min & Max will check the first element, and when there are equal values, check the next element.

 

So a compound min, compound max or compound min & max would add some value.

Min Max.PNG

An alternative Array Min & Max (or option in current function) would also add a bit of functionality (and probably some confusion).

AristosQueue (NI)
NI Employee (retired)

wiebe: Change modes.

 

Untitled.png

wiebe@CARYA
Knight of NI

Thanks, I did not know that (or I forgot about it).

 

Actually, I often want the compare elements mode, but the Array Min & Max doesn't have such an option... So a scalable Compare Elements Min & Max is not available.

Min Max 2.PNG

Not that I need this that often... A .vim would be easy to make.

 

But back OT, a compound function for min and max would not be terrible (as long as it has Compare Elements\Compare Aggregates option).

 

Darren
Proven Zealot
Status changed to: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.