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).

N: [10, 3, 1];
p(x,n):=x/n;
total(x):=sum(x[i],i,1,length(x));
logN(n,x):=log(x)/log(n);
I(A):=-sum(p(A[i],total(A))*logN(length(A),p(A[i],total(A))), i, 1, length(A));
I(N);

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-reveal-solve

eq: x^2=1;

length(eq);

answer: solve(eq);

Calculate

length

m:[[1,2,3],[4,5,6],[7...

length(m);

Calculate

length-part-solve

eq: x^2=1;

length(eq);

answer: solve(eq);

Calculate

length-solve-sum

Aufgabe:"Seite 299 un...

x:[1,2,3,4,5];

y:[11,21,31,41,51];

Calculate

length-sqrt-sum

r:[[1, 1.2], [2.5, 3....

N:length(r);

u:sum(r[i],i,1,N)/N;

Calculate

length-matrix-matrix_size-transpose

a: matrix( [1,2,3], ...

n_rows:length(a);

n_cols:length(transpo...

Calculate

length

a1:x+t;

a(x):=a1;

x:3;

Calculate

length-round-solve-sum

P0(K,r):=sum(K[i]/(1+...

K:[0.25, X, 1 + 30];

r:.1;

Calculate

length-makelist-map-sum

a: makelist(2*k-1,k,1...

sum(a[i],i,1,length(a));

f(x):= 1/x;

Calculate

length

f([u]):=u+length(u);

f([2,3,4]);

Calculate