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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

MathCAD: Using reserved symbols in variable names

dtrowbridge
10-Marble

MathCAD: Using reserved symbols in variable names

I would like to define a variable as [η] but typing the square bracket initiates a matrix definition.

ACCEPTED SOLUTION

Accepted Solutions

Much thanks to Werner_E and 24-Ruby V.  That works just fine - forming a literal string and then removing the quotes - seems like this procedure sneaks the variable name past the scrutiny of an interpreter that is looking to handle the occurrence of typed brackets.

View solution in original post

4 REPLIES 4
Werner_E
25-Diamond I
(To:dtrowbridge)

Its tricky and as far as I know undocumented, but it can be done!

 

Start by typing a double quote

Werner_E_1-1710168976404.png

And continue typing the variable name you wish to create. eta is created as usual by typing an h and then pressing ctrl-g

Werner_E_2-1710169064043.png

Now, when the cursor is in front of the closing quote, press DEL to delete the quotes and, voila, you have created the variable name you demanded.
You can use it the normal way as you can use any other variable name.

Werner_E_3-1710169258181.png

Because its creation is quite uncomfortable you may rather use copy and paste to duplicate it than retype it every time from anew.

 

If you need subscripts, you have to add them after deleting the quotes.

Werner_E_4-1710169432360.png

You can't have the reserved symbols as subscript and you cannot use all special symbols (e.g. you can't create a variable name containing a space that way).

Actually reserved symbols can be used in subscripts, too

Werner_E_0-1710170728426.png

but its much harder to create them in Prime. The above variable was created in Mathcad 15 and the file then converted to Prime.
In Prime, without using MC15, you can open a text region by pressing ctrl-t and type in

(@ID ab (@SUB [cd]))

copy this text by highlighting it and pressing ctrl-c

Then in an empty space in the worksheet type a colon to create an assignment and then press ctrl-v to insert the text you copied just before into the left placeholder.

This should create a variable you can assign a value and use at your will

Werner_E_1-1710171438752.png

 

BTW, when you ask a question here in the forum, you are supposed to come back to close the thread and maybe comment on the answer(s) you got -> Need Sybolic Factor to operate on all terms having...

 

 

 

Much thanks to Werner_E and 24-Ruby V.  That works just fine - forming a literal string and then removing the quotes - seems like this procedure sneaks the variable name past the scrutiny of an interpreter that is looking to handle the occurrence of typed brackets.

Werner_E
25-Diamond I
(To:dtrowbridge)


@dtrowbridge wrote:

Much thanks to Werner_E and 24-Ruby V.  That works just fine - forming a literal string and then removing the quotes - seems like this procedure sneaks the variable name past the scrutiny of an interpreter that is looking to handle the occurrence of typed brackets.


Yes, you can also create variable names like the ones in the pic below which otherwise would not be allowed to type in

Werner_E_0-1710188197646.png

 

BTW,  "24-Ruby V" is not a user name but is an instance of a rather strange and stupid ranking system that is implemented here in the forum. Rankings are expressed by numbers (24) AND stone names (Ruby) AND roman sub-numbers (V) AND because thats seems still not enough we also have a speedometer for each user to indicate something as dubious as a "rank" here. I really doubt that we need all that nonsense, but ...

I also find it amusing that you marked your last answer as the 'solution' to the question - but don't worry, it really doesn't matter 😉

 

For some reason, I did not read all the way to the end of your initial reply.  So, I missed the tip about closing the thread.  I instinctively thought that some form of closure might be needed, which was may intention in identifying that the discussion had arrived at a "solution".  I'll try to get up to speed.

Announcements

Top Tags