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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Format of matrices

Ingalls
4-Participant

Format of matrices

After migrating from MathCad 15.0 to MathCad Prime 8.0, I have a matrix in one sheet formatting exactly as I want it like this:

MI_8700287_0-1672178732810.png

However, in a very similar sheet, also migrated to Prime 8.0, the format has changed to this:

MI_8700287_1-1672178880465.png

The matrix will not display if I attempt to move the "ft" unit outside the matrix.  It is not a big deal for something small like this, but for a larger matrix, as below, it becomes cumbersome to get it to print.

MI_8700287_2-1672178974109.png

The matrix here is built the same way as the first image using the "stack" and "augment" functions, and the error message that pops if I attempt to format like the first image is "This value must be a scaler or a matrix."

 

What can I do to format a matrix to get rid of the units for each individual value, and apply it to the overall matrix as I have in the very first image, just like MathCad 15.0 used to do?

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:Ingalls)

I already noticed and edited my previous reply why you sometimes see the desired display even in Prime. Its only after conversion. Whenever you recalculate the sheet either by pressing F5 or F9 or if you force recalculation because you change values, the display of the matrix turns into the one you dislike.

 

Here is something which might be a (not at all perfect and quite clumsy) workaround. It would be needed to modify the strings in "RowLabel" (isn't it rather ColumnLabel?) so their width fits the width of the data column. Really uncomfortable and honestly I won't be willing to jump through that ring 😉

Werner_E_0-1672185250181.png
Werner_E_1-1672185263906.pngTo access the data values you would have to use something like

Werner_E_2-1672185309212.png

I guess you would rather like to live with the wide display with it many units ...

 

 

View solution in original post

5 REPLIES 5
LucMeekes
23-Emerald III
(To:Ingalls)

The unit placed after the Matrix should indicate that that unit applies to ALL elements of the matrix. With your first matrix that cannot (or should not) be, because it contains (only) strings in the first column, and strings do not (should not) have a unit attached.

I think this construct exists due to a flaw in the conversion process.

I guess this explains why you cannot alter the unit position in your other matrices.

 

Success!
Luc

Werner_E
25-Diamond I
(To:Ingalls)

I can confirm that real  Mathcad used to give the result you ant to see and I also second what Luc said, namely that this behaviour wasn't quite correct because a unit should bot be applied to a string . As you can see in the last expression, MC15 is handling that augmented matrix somewhat inconsistent as it would not allow to get rid of the unit in the first string column:

Werner_E_0-1672182302813.png

 

When I converted the above sheet, the result was the one you dislike. I wonder what we have to do to get the result in prime your first picture is showing.

EDIT: NO, I don't wonder anymore. If you open the converted sheet the first time, you see what real Mathcad would have shown (the display you demand). But as soon as the sheet is recalculated, the other (correct, but not desired) display shows up.

I guess that in Prime you can't get the result you'd like to see. To save space you may get rid of the units altogether by dividing the second vector/matrix by the unit (feet) before you augment the two.

Strings in a matrix with units can be even worse as you are not able to change the displayed unit (lets say from feet to meter or yards) as long as the unit is displayed insider the matrix (which is necessary if not all elements share the same unit).

Ingalls
4-Participant
(To:Werner_E)

It would be pretty fantastic to have the display work the way old MathCad did.

I had thought about dividing the equation by the unit, as well, but I do reference this sheet where I need the unit to complete my next steps.

 

I also get that you can't change the units inside that stacked or augmented matrix, which also really sucks.

In the sheet I have attached, it is a bit of a mess, but I think you'll get the idea.  Also, I set the origin for my matrices to "1", not "0".  I'm not sure if that stays with the sheet, or if you may need to change it when you open it.

 

Thanks for the assistance.

Werner_E
25-Diamond I
(To:Ingalls)

I already noticed and edited my previous reply why you sometimes see the desired display even in Prime. Its only after conversion. Whenever you recalculate the sheet either by pressing F5 or F9 or if you force recalculation because you change values, the display of the matrix turns into the one you dislike.

 

Here is something which might be a (not at all perfect and quite clumsy) workaround. It would be needed to modify the strings in "RowLabel" (isn't it rather ColumnLabel?) so their width fits the width of the data column. Really uncomfortable and honestly I won't be willing to jump through that ring 😉

Werner_E_0-1672185250181.png
Werner_E_1-1672185263906.pngTo access the data values you would have to use something like

Werner_E_2-1672185309212.png

I guess you would rather like to live with the wide display with it many units ...

 

 

Ingalls
4-Participant
(To:Werner_E)

Thank you.  That is a workaround I hadn't thought of, but I agree with you that I'm not sure I want to jump through that hoop.

I was thinking of the possibility of redefining a variable with "Display" in the variable name.  I can keep the working variable as Elev.POI.S2 for ease of computation later.

I also agree that "RowLabel" is the column label, but when I originally set this sheet up I had named the variable "RowOfLabels" and shortened it to "RowLabel" at some point in development.  It's still a work in progress and migrating to Prime threw a bit of a wrench into development for the time being.  1000's of sheets had to be migrated, reformatted, etc.

 

Thank you, again, for looking into it. 

Announcements

Top Tags