05. 01. Defining and Clearing a Function in Maple

05.01. Определение и удаление функций в Maple 

Once you have defined a function, Maple will remember that function during your entire working session. If you want to overwrite the function with a new definition, you simply retype the definition. For example, if you want to replace the function f(x) above with ln(cos 5x), type:

Если Вы единожды определили функцию, то Maple это запомнит до окончания рабочей сессии. Если Вы вдруг захотите переопределить функцию f(x), например, на ln(cos 5x) , то просто напечатайте:

 

 

 

 
 

 

> f:=x->ln(cos(5*x));

f := proc (x) options operator, arrow; ln(cos(5*x))...

 

We can confirm the current value for the function f(x) :

Можно вывести текущий вид функции f(x):

 
   

> f(x);

ln(cos(5*x))

 

If you want to clear the function f(x) without redefining it, type:

Можно избавить переменную f от её функциональных обязанностей командой:

 
   

> f:='f';

f := 'f'

> f(x);

f(x)

 

It's always a good idea to clear your functions when you start a new problem. Alternatively you can use restart to clear everything from memory.

Напомним, что Maple обладает прекрасной способностью очищать свою память по команде restart . При этом все введенные Вами функции будут стерты.

С официального разрешения                    © 2002 Waterloo Maple, Inc

 

Hosted by uCoz