Mathematica Tag × protected in Mathematica?

  • Thread starter Thread starter nikolafmf
  • Start date Start date
  • Tags Tags
    Mathematica Tag
Click For Summary
The discussion centers on a Mathematica error message indicating that "Tag Times in 0 × 1.52098*10^11 is Protected." Users are seeking solutions to obtain calculation results despite this error. It is suggested that the conditional statement should be corrected from "i = 300000" to "i == 300000" to resolve the issue. Additionally, it is noted that a right bracket is not actually missing, as the entire expression is complete. The proposed adjustments include ensuring proper syntax in the conditional statements and correcting the assignment of variables to eliminate the error and successfully print the desired results.
nikolafmf
Messages
112
Reaction score
0
Instead of giving the results of the calculation, Mathematica says:

"Tag Times in 0 × 1.52098*10^11 is Protected."

as in the attached file. Anyone has any idea how to get the results?
 

Attachments

Physics news on Phys.org
The line
Code:
If[Or[i == 100000, i == 200000, i = 300000],
should read
Code:
If[Or[i == 100000, i == 200000, i == 300000],
 
It still says tag is protected, but also prints the results, which is what I want.
 
DrClaude said:
The line
Code:
If[Or[i == 100000, i == 200000, i = 300000],
should read
Code:
If[Or[i == 100000, i == 200000, i == 300000],

Also, there's a right bracket missing in both expressions above.
 
The right bracket is not missing, since the whole sentence is:

If[Or[i == 100000, i == 200000, i == 300000],
Print[NumberForm[x, 13], "\t", NumberForm[y, 13], "\t",
NumberForm[r, 13], "\t", u, "\t", v, "\t", NumberForm[w, 6], "\t",
i*h, "\t", NumberForm[average, 13]]]
 
Change

i = 300000

to

i == 300000

and

If[r < j, j = r]

to

If[r < j, j = r];

and your problems seem to go away
 
Last edited:

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K