Skip to main content
4-Participant
May 22, 2023
Solved

How do I make a list in Mathcad Prime

  • May 22, 2023
  • 2 replies
  • 3187 views

Hello, I am trying to do a "list" of numbers in Mathcad, like that :(4.6, 5.6, 8.8). It is for programming purpose as I want to do an "If" condition if my variable is equal to one of those values. What I really want to do is get α_v in function of the grade of the bolt and if the shear stress passes through the threaded portion of the bolt (see pic). 

Arnoldo_Idolo_0-1684766704245.png

 

Best answer by Fred_Kohlhepp

You need to create a table and use the "match" function.  Attached is Prime 4

2 replies

23-Emerald I
May 22, 2023

You need to create a table and use the "match" function.  Attached is Prime 4

4-Participant
May 23, 2023

Hello Fred, 
Thank you for your answer, simple and effective. Occam's razor really is sometimes the right way to solve problems.
Have a fantastic day!

25-Diamond I
May 22, 2023

As so often there a many ways to achieve the desired goal.

You may add the variable value for alpha as an output of the first combobox and override it by the single value 0.6 in case that the second combobox returns "no".

Werner_E_1-1684788245477.png

In a combobox it is not necessary to provide the first column of display names. If you don't, the first column of return values is used instead for display. There is also an option to hide the left hand side with the variable(s) of a combobox and you can assign the output of a combobox to a vector of variables.

I made use of this and you can see how if you select a combobox (right mouse click) and chose "edit".

Unfortunately what PTC implemented as combobox is very basic and limited. Otherwise it would be able to use variables in the return vectors and so selecting "yes" could return alpha_v and "no" would return 0.6. That way we could do without the region with the if function. Maybe PTC will improve their unfortunate creation in a future version.

 

4-Participant
May 23, 2023

Hello Werner, 
I like your answer a lot! Thanks for your time, I really appreciate it. Those comboboxes tips surely are going to help me
Have a fantastic day!