Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hi there,
I have a variable with 100 values inside and I want to check every 5 values to find the minimum between them. I need to do that through the entire values ... this means 20 times . I tried to write it this way but not working :
z , and q are related to each other . q is the resistance at z depth ..
the results I expect is : the program will check q at each z and will choose the minimum (q , 15MPa) but will do this in intervals 5 values by 5 values .
the sheet can't be attached again . I attached zip file
thanks
Yusra
Solved! Go to Solution.
Here are two implementations of how I understood your question.
The first uses the "submatrix" function to get the minimum of the five values, the second uses a nested for-loop.
Prime 11 sheet attached
Hi Yusra,
Try this:
You should be able to call it with:
But you'll also need an associated Z array:
Now you can plot Q versus Z.
Success!
Luc
Hi Luc
in Z array why you used (i-1)*5+3
Thanks
I had to reduce the length of array z to that of Q to make array Z. I decided to take the middle value of each group of 5 z values for that.
Success!
Luc
Here are two implementations of how I understood your question.
The first uses the "submatrix" function to get the minimum of the five values, the second uses a nested for-loop.
Prime 11 sheet attached
there is one remark here .. the result should be 100 values not 20 values only..... I wanted to compare one by one in each 5 values
which means we divide the 100 values to 20 groups in each group 5 values > and then compare each member to 15 and choose the minimum...
The end results will still be 20 groups but with the minimum values.
Unfortunately, I cannot identify a comprehensible algorithm in your description. You may need to provide one or, better yet, several concrete examples to clarify the task.
Do you mean that the desired result should consist of groups of five with identical values?
Ok thanks anyway .
