Skip to main content
14-Alexandrite
October 15, 2024
Solved

Min function

  • October 15, 2024
  • 2 replies
  • 3272 views

Just one question about ( min function) why it works only with scalars ... whenever I want to use it with vectors or matrics  it doesn't work ... 

How to overcome this ? 

Should I always use programming ?

 

For example the following program : in each (qc;gem;cor ) I have 3 matrics each one has ten values.... what I need is to write a program that will compare the both variables and choose the minimum value of each one ( compare the first raw with the first raw  and chooses the min ...and so on  ) ...and the result should be also one matric with ten values. However, it chooses only the minimum value of each matrics 

YA_10963798_0-1729002032652.png

 

Best answer by Werner_E

It seems to me that @YA_10963798  would need you function but for only two inputs.

Applied to the simpler example posted in the other thread this would mean

Werner_E_0-1729009893915.png

BTW, I seem not to grasp the necessity of your local function minv?

Prime 9 sheet attached.

 

2 replies

23-Emerald V
October 15, 2024

Try something like the function Min shown below.  It recursively calculates the minimum of each nested array ... well, it's supposed to!

 

2024 10 15 C.png

 

The last one is messy but interesting.

 

Stuart

14-Alexandrite
October 15, 2024

Hi Stuart, 

I tried it 

YA_10963798_1-1729006447954.png

 

Actually what I need is something different I need the program to compare qc;gem;1 and qc;gem;2 and choose the minimum between both of them.

So , it goes to the first raw in both variables and choose the min and then goes to the second one and does the same. 

but what we did is just choose the min value in each matric

 

25-Diamond I
October 15, 2024

Why not post a simple example sheet so we have something to play with?
See also my suggestions in the other thread...

25-Diamond I
October 15, 2024

It sure may be a good idea to open a new thread for a different question. Just try to avoid to ask the same question twice.

Stuarts approach here sure is way more generic than my basic attempt there -> Solved: Re: Minimum values depending on layer thickness

I am not sure how to use his function to get the same result (for v1 and v2 in my example there)

But then its still unclear to me which single 10x1 vector you would expect as result in your example. See my remarks in the other thread for this.