Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.1K Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Working with indexing?

Posted 4 years ago
POSTED BY: Christoph W
4 Replies

This support article addresses the issue of variables with subscripts and superscripts: https://support.wolfram.com/43606

POSTED BY: Jesse Friedman
Posted 4 years ago

As you've noticed there are odd things that can happen using subscripts (and superscripts) in calculations. The solution: Don't use subscript and superscripts in calculations.

But you can have the desired effect (which was posted recently either in this forum or Mathematica.StackExchange - I can't find it at the moment) using the Format statement.

Format[\[Sigma]KEuler, Subscript[\[Sigma], Subscript[K, Euler]]];
\[Sigma]KEuler = 10;
\[Sigma] = 5;
\[Sigma]KEuler/\[Sigma]
(* 2 *)
POSTED BY: Jim Baldwin
Posted 4 years ago

But an underscore isn't a legitimate part of a variable name.

POSTED BY: Jim Baldwin
Posted 4 years ago

The issue can also be fixed when naming Sigma into Sigma_Something

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