Tag × protected in Mathematica?

  • Context: Mathematica 
  • Thread starter Thread starter nikolafmf
  • Start date Start date
  • Tags Tags
    Mathematica Tag
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 6K views
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: