Message Boards Message Boards

0
|
9900 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Variable names - capital letters with subscript and/or superscript

Posted 9 years ago

Hi, For variable names, the documentation states - "The Wolfram Language uses both uppercase and lowercase letters. There is a convention that built?in Wolfram Language objects always have names starting with uppercase (capital) letters. To avoid confusion, you should always choose names for your own variables that start with lowercase letters." I have some groups of formulas that use both upper and lower case letters - the capital letter means one thing and the same lowercase letter means something different yet related to the capital letter. Can I use capital letters with subscripts or superscripts for variable names? Or, does that violate the above documentation guidance? Thanks, Mike

POSTED BY: mike_turner_12
4 Replies

It too might take on a different meaning then what you intended

In[1]:= max = 5

Out[1]= 5

In[2]:= Subscript[C, max]

Out[2]= Subscript[C, 5]
POSTED BY: Kay Herbert
Posted 9 years ago

Ok - Thanks Kay As you can probably tell, I'm new to Mathematica. I'm playing around with some equations from a text book and wanted to follow the textbook naming conventions as much as possible to minimize any errors. It's not that big of a problem - I can adopt some naming conventions that are close enough. Thanks again for your help. Mike

POSTED BY: mike_turner_12

I wouldn't because they too can have unintended meanings:
In[1]:= Pi

Out[1]= \[Pi]

In[2]:= Pi^2

Out[2]= \[Pi]^2

In[3]:= N[%]

Out[3]= 9.8696
POSTED BY: Kay Herbert
Posted 9 years ago

Thanks Kay. I see what you mean about superscripts. For subscripts I was thinking of something like capital "C" and a subscript or "max" or "min" Do you think that would be a problem? Mike

POSTED BY: mike_turner_12
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract