Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

definition variable name containing variables

Status
Not open for further replies.

bkrell

Structural
Nov 17, 2010
6
0
0
US
Anyone know of a workaround so a definition name can contain undefined variables? I'm attempting to have a user input a ratio and have the variable name appear as the ratio of the two previously undefined variables (i.e. Mn/Op := ___ , Mn and Op undefined). Mathcad gives the error that Mn and Z aren't defined, as expected. Any insights are appreciated.
 
Replies continue below

Recommended for you

Don't try to fool mother nature. I tried to define roughness over diameter as E/D and never got it to work. I ended up with E_D and wondered why I tried to fight that battle.

There are a lot of valid ways to do it:

Ratio[sub]mn_Op[/sub]
MN_OP
MNdividedByOP

Any of them would work good enough.

David
 
Oh, for that, you want:
Mn<CTRL><SHFT>k/<CTRL><SHFT>kOp, which will give you a variable name "Mn/Op" but, you'll need to do the same sequence each time, unless you just copy/paste the original entry.

Note, however, if Mn and Op are actually undefined, then you'll still get an error, since Mathcad will not allow you to define a non-function calculation with undefined variables in it.

TTFN

FAQ731-376
Chinese prisoner wins Nobel Peace Prize
 
Well sounds like I'm SOL in this instance. zdas04, any of those would work well enough, but I needed the variable to visually appear like the table headers from which the ratio would be input. IRstuff, thank's for the <ctrl><shft>k trick. Too bad it can't override the undefined variables in the name. Thanks to both for the input.
 
Status
Not open for further replies.
Back
Top