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:

Length

Function: length (<expr>) Returns (by default) the number of parts in the external (displayed) form of <expr>. For lists this is the number of elements, for matrices it is the number of rows, and for sums it is the number of terms (see dispform).

_entropy(x):=if (x=0) then 0 else x*log(x);
entropy(p,b):=-sum(_entropy(p[i])/log(b), i, 1, length(p));
entropy2(p):=entropy(p,2);
_total(x):=sum(x[i],i,1,length(x));
entropyArray(a):=entropy(map(lambda([x], x/_total(a)), a), _total(a));
/* traditional 2-based entropy */e:entropy([1/4,1/4,1/2,0], 2);
/* 1-based */e:entropy([1/4,1/4,1/2,0], 4);
/* over an array */ea:entropyArray([1,1,2,0]);
ev(e=ea);
bfloat(e);

The length command is affected by the inflag switch. So, e.g. length(a/(b*c)); gives 2 if inflag is false (Assuming exptdispflag is true), but 3 if inflag is true (the internal representation is essentially a*b^-1*c^-1).

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

(%o1)                                true
(%i2) 

Related Examples

length-numer-sum

X:[3,2,4,3,2,5,1,2,5,...

n:length(X);

m:n/(sum((1/X[i]),i,1...

Calculate

length

Urliste:[ [w,...

length(Urliste);

Calculate

length-numer-pi-plot2d-sqrt-tan
plot2d(speed, [distance, 2, 20], [y, 30, 70]);

g:32;

slope:tan(74/180*%pi)...

height:8+1/12-1;

Calculate

length-solve

f(x,y) := x[1]*y[1] +...

a1 : [-5,-1,-5,5];

a2 : [4,5,2,4];

Calculate

length-not-or-part-reveal

((reveal(part((not(L(...

Calculate

length

X:[3,2,4,3,2,5,1,2,5,...

n:length(X);

m:(prod(X[i],i,1,n))^...

Calculate

length-solve-sqrt

eq1:[3,5].[x1,x2] = 131;

eq2:length([x1,x2]) =...

solve([eq1,eq2],[x1,x...

Calculate

length-sqrt-sum

norm(x):=sqrt(sum(x[i...

Calculate

length-makelist-reverse

"*"/* Eine Polynomfun...

"*"/* Eingabe der Pun...

Punkt:[[-4,0],[-1,-3]...

Calculate

length-load-sum

x:[3,4,1,5,5,3,1,2,1,...

load(descriptive);

gruppierung:discrete_...

Calculate