Skip to main content
1-Visitor
Jun 26, 2014 4:31 PM UTC
Solved

Rounding values in a matrix

I am stuck on something very simple and hopefully there is an easy answer. I need to round all of the values in a matrix to the nearest integer. I have provided a quick worksheet to work with as an example. I have scaned through all of the functions for vectors and matricies and do not see anything helpful. I am using mathcad prime 3.0.

23-Emerald I
Jun 26, 2014 4:48 PM UTC

What you're looking for is "vectorize"

4 replies

23-Emerald I
Jun 26, 2014 4:48 PM UTC

What you're looking for is "vectorize"

Translate
1-Visitor
Jun 26, 2014 4:49 PM UTC

My Prime tales a long time to open but have you tried using "Math Formatting" tab and change the default (3) decimal places to 0?

Make certain that the matrix is active (select it) before you apply the format.

I hope this helps.

Norm

Translate
1-Visitor
Jun 26, 2014 7:24 PM UTC

That would work if he assigned A to another variable, but he cannot reduce the number of decimals places if A is evaluated as he has defined the matrix above.

Clipboard01.jpg

Translate
1-Visitor
Jun 26, 2014 7:21 PM UTC

As Fred pointed out you need to explicitly vectorize the A, as it is a matrix.

round works in this case as you have not specified the number of digits to round to.

Translate