Skip to main content
10-Marble
March 19, 2025
Solved

How do I display only the value of a variable?

  • March 19, 2025
  • 4 replies
  • 2469 views

I want to present results in a table I created.

But having the variable name showing when I want to display the results is really not convenient.

Anyway around that other than hiding the name with a white box?

 

I mean...

It's Mathcad...  Not Paint...

 

Thanks

Best answer by AP_12953245
Guys,

I was able to do what I wanted using Excel Components.

It lets me create a table and display variables without their names.

Tks
Alex

4 replies

25-Diamond I
March 19, 2025

If you really want to display just the numerical result but want to hide the information about the associated variable name, you could use the Text Box (advanced controls) wit the variable as input (which you could hide. You could add any text you like, chose font size, color etc.

 

In (real) Mathcad we could use the symbolic evaluation because we had the options to hide the keywords and the left hand side of an evaluation. All that remained was a right arrow, though, Maybe Prime will offer this functionality, too, one day ...

 

Here is an example of using a scripted control:

Werner_E_1-1742408490697.png

 

EDIT: Following Luc's suggestion I also added an Excel component to do something similar.
I don't like using embedded Excel  components but it may be a matter of personal preference.

 

Prime 10 sheet attached

 

23-Emerald IV
March 19, 2025

In Mathcad you could hide any part of the worksheet behind a picture:

LucMeekes_0-1742407021511.png

Here I took a picture from the Prime background and hid part of Variable. You could send items to the background or to the foreground, Obviously I sent the math region to the background.

 

In Prime that doesn't work, Pictures always seem to be transparant for math regions and you cannot send to back- or foregound:

LucMeekes_1-1742407202351.png

Here I tried to hide part of Variable with a picture part of Mathcad's background.

 

Would it help to embed an excel table in the prime worksheet and show that?

 

Success!
Luc

10-Marble
March 19, 2025

I have tried to use the Excel component but when trying to update it, it always tells me that Excel is busy even though there is no instance of Excel running.

Very frustratingโ€ฆ

25-Diamond I
March 19, 2025

@AP_12953245 wrote:

I have tried to use the Excel component but when trying to update it, it always tells me that Excel is busy even though there is no instance of Excel running.

Very frustratingโ€ฆ

 


Unfortunately this happens ever so often when using the embedded Excel components.

It's quite possible that an Excel instance is still running but not visible. In this case, it might help to check the Windows Task Manager under Details to see if an Excel process is still running there, and then kill it there.

If you search the forum for "Excel busy" or the like you will find some threads where people complain about this very problem. As far as I am aware there is no final solution. Some tell that repairing the M$ Office installation cured the affect, others think that it does not work wit M$ 365 at all and you would need a "normal" Office.

I seldom use embedded Excel components because I consider them unreliable, I use a "normal" Office 2016 and from time to time I get this annoying "Excel is busy and needs to be started.." . I am not sure why and how to reliably reproduce the error.

 

BTW, I edited my answer above and attached a modified sheet which additionally includes an Excel component. Maybe you want to give it a try and have more luck doing so.

14-Alexandrite
March 20, 2025

@AP_12953245 I see that you want the results in a table but to remove the variable because it is redundant. 

 

I have a suggestion that I use quite often to display a not-so-large tables of results.  I compile my results to a matrix and add row and/or column headers directly.  I still have to use a variable but you can always use a short variable.  In the end it's about displaying results in a grid .  If the matrix is too wide, then maybe transpose it and modify your headers.  

 

My input data uses the nicely formatted "table" feature (I wish my output looked similar):

SPaulis_1-1742487597739.png

 

And here is my summary table after all the calculations are done.  In the summary table I only need to know the D/C values for each check and I use the OK/NG text because, for me at least, it is easier to spot the problems.  I sure wish we had coloured extended ascii characters as the Mathcad font.

 

SPaulis_0-1742487045491.png

 

I just tried transposing the table and quite frankly I like this summary table better for this calculation sheet.  I usually do not have that many scenarios, but I can spot the problems even easier.  As you can see, the direction of the table is up to you to make the output look best:

 

SPaulis_0-1742488466319.png

 

 

One problem I have is if I have multiple columns of different units.  Mathcad does not allow you to choose your default units other than the base dimensions in SI, US and CGS.  In those cases, you may want to strip the units and add the units as text in your header row/column.

There are multiple user requests about having formatted output tables, similar to the input tables.  As an example, see https://community.ptc.com/t5/Mathcad-Ideas/Tables-Results-Tables/idi-p/470236.  Maybe you can help out by up-voting some of these ideas so that PTC will see the importance of the idea.

23-Emerald IV
March 20, 2025

OK, I gave it another shot.

How's this:

LucMeekes_0-1742494773384.png

and printed:

LucMeekes_1-1742494809113.png

I suppose, if you switch off the grid display it will not print either.

 

Prime and pdf files attached.

Success!
Luc

25-Diamond I
March 20, 2025

I consider this quite uncomfortable as this method makes all instances that are labelled as โ€˜variablesโ€™ disappear and they would have to be made visible again manually by recolouring them - very tedious!
But I can confirm that this method works in the printout as well.

 

BTW, you can only make them vanish completely either in print when you choose pure white (255:255:255) as you did OR on screen by choosing the Prime background color 246:250:246 ๐Ÿ™‚

 

But I have the feeling anyway that the questioner quickly loses interest and leaves his threads orphaned -> How do I get Mathcad to give me ...

23-Emerald IV
March 20, 2025

"Very tedious": I tend to disagree.

The sheet can just be set up normally, with ordinary colours for each of the label styles. Then just before printing, change the colour of the Variable label style to white, so they all become white; that is in one go. Then print, and after print set the colour of the Variable label style back to the original colour and all is readable again.

I only coloured the assignment black, so it would remain visible, but I guess that isn't necessary for the OP. I suspect he wishes to use this to print calculation results on a preprinted form, where locations (boxes?) are reserved for the values needed.

 

Luc