Message Boards Message Boards

0
|
4758 Views
|
5 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Getting error while trying to print output

Posted 10 years ago
I just started using mathematica on my mac. I need to draw a graph and perform depth first search on it. But whenever I try to plot the graph using GraphPlot function, I keep getting an error that went like this "SetDelayed::write: "Tag In in In[] is Protected"". How can I remove this error?
POSTED BY: ra1717
5 Replies


Sounds like there are two issues going on.

a) The semicolon at the end of your input line says to not make an output in the notebook window.

b) One or more variables are set somehow so there is a loop in the graph.

You can start with a new Mathematica session, quit and restart the Mathematica Kernel
(Evaluation menu - Quit Kernel - Local), or look to see if vertex names were defined somehow.

? Global`*
will print out the names of the user variables and symbolic constants as hyperlinks -
click on each one to see if it has a value, or just a name (example, Global`d).


The cell labels, In, are generated by Mathematica.  You do not enter them.
POSTED BY: Bruce Miller
Posted 10 years ago
Tried to do that also. But sometimes I get following error:
$RecursionLimit::reclim: Recursion depth of 1024 exceeded
and sometimes, it just works but I get no output, just blank spaces.
POSTED BY: ra1717
Posted 10 years ago
I wrote the following command:
In[1] := GraphPlot[{a -> c, a -> d, c -> e, c -> g, e -> h, e -> g, j -> g,  g -> b, h -> g, d -> f, d -> h, f -> k, f -> i, i -> h, i -> d, i -> b}, DirectedEdges -> True, VertexLabeling -> True];
The first time it worked, after that I keep getting the same error.
POSTED BY: ra1717
The problem is this
In[1] :=
I am not sure what you wrote that there for. Simply remove it. If you want to assign the expression to variable, you can write
myGraph = GraphPlot[{a -> c, a -> d, c -> e, c -> g, e -> h, e -> g, j -> g,...... etc....
POSTED BY: Nasser M. Abbasi
May be you had something like `x+y = 5` and may be 1000 other possibilities. The fix is to allow the left side of the assignment be assigned to. May be others will have better guess. It would have been easier if you could post the code that produced the error.
POSTED BY: Nasser M. Abbasi
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