Message Boards Message Boards

0
|
10283 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Clear function

Posted 9 years ago

I define a function y=f(x), I evaluate the function @ some x and the later time I want to integrate the same function. I used clear[x] and clear[y] But still get wrong answer. How to clear? And is there anyways in Mathematica to clear the screen as such you can start everything from the beginning?

POSTED BY: Dodji Cohovi
4 Replies

If you are using the function syntax y=x^2, you had better use replacement rules to calculate at given values of x:

Clear[x, y];
y = x^2;
y /. x -> 3
y /. x -> 5
Integrate[y, x]
Plot[y, {x, -2, 2}]

so that you don't need to clear values. However, I would rather do it this other function syntax:

f[x_] := x^2;
f[3]
f[5]
Integrate[f[x], x]
Plot[f[x], {x, -2, 2}]
POSTED BY: Gianluca Gorni

It only restarts the Kernel, so all definitions are lost. But the frontend is still active. If you want to clear that, just create a new notebook or select all and press delete.

POSTED BY: Sander Huisman

To start from the beginning reset the Kernel. This will clear all definitions.

You can also do that by executing Quit[]

POSTED BY: Sander Huisman

**Thank you Sander. I did tried both. But the screen till exactly the same. Nothing changed. ** Right now the only way to clear the screen is to select every single subsection in the notebook and delete them manually.

Here is the notebook and I finish by Quit[] and press shift enter but nothing happened to the screen. Also in that file I was trying to use the Grid function but it fails every time I try. Thanks for your help.

Attachments:
POSTED BY: Dodji Cohovi
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