Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hi there,
I'm trying to compare a result I got as a array to one value .... if the condition is not meet the program should show error >>> it should compare each value in g... to explain it goes to the first row in g which contains a matrix (5*1) and compare the all the numbers in that matrix if it doesn't meet the conditon it writes error ... then goes to the second row in g and do the same
this is from the orginal sheet :
Prime 10 is attached
Solved! Go to Solution.
@YA_10963798 wrote:
What I expect is option 3 : a similar nested 5x1 vector as g but with values below 25 replaced by NaN, "error" . How did you do it 🙂
That way - the local function "replace" is called vectorized for every of the five vectors in g.
If you need that kind of check more often in the sheet and maybe with different conditions, it may be worth turning it into an appropriate function.
Prime 10 worksheet with all variants attached
Can you tell me why did you put verife=0 in your function
So what do you expect as answer to your demo data set?
Is it the 25x1 vector which Alan shows or is it rather a 5x1 vector with all "error" because none of the five matrices in g consist of values which ALL are larger than 25?
Or, as a third possible interpretation which comes to my mind, do you expect a similar nested 5x1 vector as g but with values below 25 replaced by NaN, "error" or whatever?
So the options as I see it are
What I expect is option 3 : a similar nested 5x1 vector as g but with values below 25 replaced by NaN, "error" . How did you do it 🙂
@YA_10963798 wrote:
What I expect is option 3 : a similar nested 5x1 vector as g but with values below 25 replaced by NaN, "error" . How did you do it 🙂
That way - the local function "replace" is called vectorized for every of the five vectors in g.
If you need that kind of check more often in the sheet and maybe with different conditions, it may be worth turning it into an appropriate function.
Prime 10 worksheet with all variants attached
Thank you so much Werner .... Really appreciate it