Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
How can I exculde some values to get the function runing without affecting the results?
I want to exulde the zeros.
It is on page 28
Thanks in advance
Solved! Go to Solution.
If you really prefer to rather modify the vector, replacing zeros by NaNs, you may do it like this:
Personally I would prefer using a more generic, versatile utility function
Could you kindly post your "CPT Input gef.xlsx" workbook, please? I tried substituting CPT Input, but that is throwing up errors trying to define each element of qcza and fs.
Stuart
Thank you.
Why don't you just use "try... on error...." in the calculation of R ?
BTW, writing 100% has no effect, its just a multiplication by the number 1.
If you wan the result to be displayed as % value, you have to format the result accordingly.
The gef Excel workbook cleared up the initial errors.. There are quite a few further down the Mathcad worksheet, though. More importantly, there are only 26 pages, so page 28 has gone walkabout. I couldn't find an area in the Mathcad worksheet that looked like the above, either - although I might have missed it. Can you check please check that the Mathcad worksheet you posted is the same one that has the problem? (I've sometimes been guilty of not saving a worksheet before posting it, so these things can happen)
Stuart
Maybe this helps.
No need for a 28 page worksheet which takes long to load, takes long to finish calculating and does not contain the problematic region at all!
Better for future questions: Create a small(!!!) worksheet with dummy data which shows the very same error!
If you really prefer to rather modify the vector, replacing zeros by NaNs, you may do it like this:
Personally I would prefer using a more generic, versatile utility function
Thank u
@YA_10963798 wrote:
Hi Werner,
I hope you are doing well.
I have a question >> Is the (if) you used in your answer the same (if) in the programming dropdown list or it is kind of different? because I couldn't it write it
No. its not the program if-statement but I rather used the if function.
Simply type "if(" and you will see that the letters "if" change from italic to to upright boldface, indicating that they are now labelled as 'Keyword' and not as "Variable'.
The if-Function is very similar to the 'if" command ins spreadsheets like Excel.
For more complicated expressions its harder to read, but for simple ones I prefer it because it takes up less space than the if-statement.
The following two functions are equivalent and you can see the difference:
The first one has the additional advantage that is also works in the free Prime Express version.
In the second we could delete the vertical program indicators and now that function would work in Express, too. But I think it could not be created from scratch in Express.
You could also use
which works because 'return' quits the program and so the last line is only evaluated if x is not 0.
Und siehe da, wenn die Nächte dunkler werden, naht die Saison der Katzenhäute.
If someone really wants to exclude values from a vector, ...
I've been bitten before by forgetting that Mathcad's lookup function definition of "eq" means to "be within TOL".
I couldn't decide whether to use match's or trim's argument order, so when in doubt, opt for the most confusing.
Stuart