cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Set Tol to Truncate Small Values to Zero in Matrix Prime 10

cadtelsim
10-Marble

Set Tol to Truncate Small Values to Zero in Matrix Prime 10

Would someone please help me with setting the document tol so that very small values in the matrix show as zero? Thanks

ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald III
(To:Werner_E)

Ah, true, I'd forgotten that (if I ever knew it).  Surprisingly, I did notice the change in M10 random number functions to go unitless, so rolled my own to replace the new built-in functions and extend them to the complex domain, but that's a story for another day.

 

An alternative to applying functions conventionally to a value is to use them as units.

 

Here's a unit tolerant version of a function I'd created earlier ("Worksheets are written, Never meaning to send", as the old song went - and still goes).

 

This would have been a lot easier if I hadn't been deprived of my partial function application capability. 

 

And I'm still waiting for Mathcad's Unicode set to be extended to U+1xxxx, then I wouldn't have to cheat when I wanted mildly_annoyed≔"👿".

 

2024 11 02 B.png

 

Yes, I could have written round like your version, but I wanted to inspect the units and do some manipulation of them in another worksheet, and didn't feel like rewriting the function.  As you might be aware from your early-bird copy of my Expression Type Functions worksheet, I've got a variant of SIUnitsOf that (actually!) handles arbitrarily-deeply nested arrays with mixed units.

 

Stuart

View solution in original post

7 REPLIES 7
ttokoro
20-Turquoise
(To:cadtelsim)

Change equation format.

image.png

StuartBruff
23-Emerald III
(To:cadtelsim)

Adding to Tetsuro's result, ...

 

2024 11 02 A.png

 

Stuart

Werner_E
25-Diamond I
(To:StuartBruff)

Unfortunately "round" can only be used with unitless arguments.
An alternative could be "Round" (note the capital "R")

Werner_E_2-1730550305419.png

We could turn this method into a small utility fuction

Werner_E_3-1730550459104.png

We could also use "round" in this way

Werner_E_4-1730550783363.png

 

Nonetheless its awkward and the formatting options we had in real Mathcad,  especially complex and zero tolerance in this case, are sorely missed 😞

Werner_E_1-1730550112430.png

 

 

StuartBruff
23-Emerald III
(To:Werner_E)

Ah, true, I'd forgotten that (if I ever knew it).  Surprisingly, I did notice the change in M10 random number functions to go unitless, so rolled my own to replace the new built-in functions and extend them to the complex domain, but that's a story for another day.

 

An alternative to applying functions conventionally to a value is to use them as units.

 

Here's a unit tolerant version of a function I'd created earlier ("Worksheets are written, Never meaning to send", as the old song went - and still goes).

 

This would have been a lot easier if I hadn't been deprived of my partial function application capability. 

 

And I'm still waiting for Mathcad's Unicode set to be extended to U+1xxxx, then I wouldn't have to cheat when I wanted mildly_annoyed≔"👿".

 

2024 11 02 B.png

 

Yes, I could have written round like your version, but I wanted to inspect the units and do some manipulation of them in another worksheet, and didn't feel like rewriting the function.  As you might be aware from your early-bird copy of my Expression Type Functions worksheet, I've got a variant of SIUnitsOf that (actually!) handles arbitrarily-deeply nested arrays with mixed units.

 

Stuart

Thank you Stuart. 

StuartBruff
23-Emerald III
(To:cadtelsim)

I'm afraid the thanks are a little premature. I overlooked the fact that local assignment is a programming functionality.

 

I think this is a Mathcad Prime Express-friendly version of round.

 

2024 11 04 D.png

 

Stuart

Thank you Werner_E.

Announcements

Top Tags