Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Apply Calculator

Apply

Function: apply (<F>, [<x_1>, ..., <x_n>]) Constructs and evaluates an expression <F>(<arg_1>, ..., <arg_n>).

foo (n) := 2 ^ n - 1 ;
fac = factor (foo (x));
apply (fac, [2, 3 , 4, 5, 6, 7, 8, 9,10 ]);

apply does not attempt to distinguish array functions from ordinary functions; when <F> is the name of an array function, apply evaluates <F>(...) (that is, a function call with parentheses instead of square brackets). arrayapply evaluates a function call with square brackets in this case.

Examples:

apply evaluates its arguments. In this example, min is applied to the value of L.

          (%i1) L : [1, 5, -10.2, 4, 3];
          (%o1)                 [1, 5, - 10.2, 4, 3]
          (%i2) apply (min, L);
          (%o2)                        - 10.2

apply evaluates arguments, even if the function <F> quotes them.

          (%i1) F (x) := x / 1729;
                                             x
          (%o1)                     F(x) := ----
                                            1729
          (%i2) fname : F;
          (%o2)                           F
          (%i3) dispfun (F);
                                             x
          (%t3)                     F(x) := ----
                                            1729

          (%o3)                         [%t3]
          (%i4) dispfun (fname);
          fname is not the name of a user function.
           -- an error.  Quitting.  To debug this try debugmode(true);
          (%i5) apply (dispfun, [fname]);
                                             x
          (%t5)                     F(x) := ----
                                            1729

          (%o5)                         [%t5]

apply evaluates the function name <F>. Single quote defeats evaluation. demoivre is the name of a global variable and also a function.

          (%i1) demoivre;
          (%o1)                         false
          (%i2) demoivre (exp (%i * x));
          (%o2)                  %i sin(x) + cos(x)
          (%i3) apply (demoivre, [exp (%i * x)]);
          demoivre evaluates to false
          Improper name or value in functional position.
           -- an error.  Quitting.  To debug this try debugmode(true);
          (%i4) apply (demoivre, [exp (%i * x)]);
          (%o4)                  %i sin(x) + cos(x)

There are also some inexact matches for apply. Try ?? apply to see them.

(%o1)                                true
(%i2) 

Apply Example

Related Examples

apply-load-sqrt

load(vect);

P:[-3,4];

Q:[7,5];

Calculate

apply-cons-lambda-last-let-sum

:lisp (defun swap (a ...

:lisp (defun pairs (i...

:lisp (pairs '(1 2 3 ...

Calculate

apply-sqrt

u:[2,1,0];

v:[3,-1,2];

w:[4,0,3];

Calculate

apply-build_info-nary-xthru

"||"([x]):=xthru(1/ap...

nary("||",110);

R1||R2;

Calculate

apply-cons-lambda-let

:lisp (defun swap (a ...

:lisp (defun pairs (i...

:lisp (pairs '(1 2 3 ...

Calculate

apply-charfun-diff-ev-gradef-newline-plot2d-print
plot2d([f,df],[x,-2,3],[x,-2,3],[y,-1,5],[style, [lines,4,3],[lines,2,2]]);

gradef(charfun(dummy)...

/* piecewise function...

/* intervals */fi: ...

Calculate

apply-coeff-lmin-makelist-sum-taylor

H : [28,30,40,42];

1/apply("*",makelist(...

sum(coeff(taylor(%,x,...

Calculate

apply-args-block-copymatrix-do-genmatrix-map-mod-quotient-return-transpose

/* http://maxima-onli...

/* conversion binaire...

/* la fonction d'acti...

Calculate

apply-lambda

f : lambda ([aa, bb, ...

f (foo, %i, 17, 29, ...

g : lambda ([[aa]], ...

Calculate