Message Boards Message Boards

0
|
4653 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Avoid default outputs with Hold[ ]?

As an example of what I input and receive:

In[1]:= f[x_] := x^2 + 2

In[2]:=f[x]

Out[2]:=Hold[f[x]]

How can I get mathematica to display the function instead of " Hold[f[x]] "?

Edit 1: A test yields:

In[279]:= f[x_]:=2*x^2
In[280]:= f[x]
Out[280]= Hold[f[x]]
In[282]:= ReleaseHold[Hold[f[x]]]
Out[282]= Hold[f[x]]
In[281]:= 2*3
Out[281]= 6
In[283]:= ReleaseHold[f[x]]
Out[283]= Hold[ReleaseHold[f[x]]]

Edit 2: After a lot of frustration I took the nuclear option. A complete reinstall fixed the issue.

POSTED BY: Steven Gilliam
3 Replies

My guess is you had set $Post=Hold at some time.

POSTED BY: Carl Woll

Sorry, I probably misunderstood.

POSTED BY: Gianluca Gorni

You can try with HoldForm[f[x]].

POSTED BY: Gianluca Gorni
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