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:

Unique Calculator

Unique

Function: unique (<L>) Returns the unique elements of the list <L>.

load (newton1);
eq1:sin(x)+cos(3*x)+1;
rng1:[-4,4];
subpart:8;
f1(x) := (if (x>=rng[1] and x<= rng[2]) then return(1) else return(2));
f1(3);
plot2d(eq1,[x,rng1[1],rng1[2]]);
li:makelist (i/subpart, i, rng1[1]*subpart, rng1[2]*subpart),numer;
sols:unique(map(round,flatten(sort(outermap(newton, [eq1], [x], li, [1E-6]))*1000))/1000),numer;

When all the elements of <L> are unique, unique returns a shallow copy of <L>, not <L> itself.

If <L> is not a list, unique returns <L>.

Example:

          (%i1) unique ([1, %pi, a + b, 2, 1, %e, %pi, a + b, [1]]);
          (%o1)              [1, 2, %e, %pi, [1], b + a]

(%o1)                                true
(%i2) 

Unique Example

Related Examples

unique

lista : [1, 2, 2, 3, ...

lista;

lista : unique(lista);

Calculate

unique

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

unique(a);

Calculate

unique

lista : [1, 2, 2, 3, ...

lista;

lista : unique(lista);

Calculate

unique

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

unique(a);

Calculate