Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
I'm trying to make a function that can sort through a matrix/range and turn very high or very low values into maximum values and leave all middle values as zero. However mathcad seems to just set everything as zero despite earlier inequalities being true, is there any way to sort this?
Example doc attached
Like so?
Alan
While I would prefer Alans way with the for-loop because the calculation block is self-contained, you can do it as you tried using a global range variable "i", too. But I have no clue what you intended to do with the product symbol.
BTW, Alans solution returns a truncated vector in case the last value in x is not out of the middle range. You can easily copy with that by placing xt[last(x)<--0 as your first command in the routine.
You may also consider using a user written utility routine to do the job:
Werner
Isaac Griffiths wrote:
I'm trying to make a function that can sort through a matrix/range and turn very high or very low values into maximum values and leave all middle values as zero. However mathcad seems to just set everything as zero despite earlier inequalities being true, is there any way to sort this?
Here's another possible way ...
Stuart