Skip to main content
1-Visitor
June 26, 2014
Solved

Rounding values in a matrix

  • June 26, 2014
  • 4 replies
  • 3387 views

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.

Best answer by Fred_Kohlhepp

What you're looking for is "vectorize"

4 replies

23-Emerald I
June 26, 2014

What you're looking for is "vectorize"

1-Visitor
June 26, 2014

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

1-Visitor
June 26, 2014

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

1-Visitor
June 26, 2014

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.