beautypg.com

HP Prime Graphing Calculator User Manual

Page 392

background image

386

Functions and commands

contains

Given a list or vector and an element, returns the index of the

first occurrence of the element in the list or vector; if the

element does not appear in the list or vector, returns 0.

contains((List, Element) or contains(Vector,
Element)

Example:

contains({0,1,2,3},2) returns 3

CopyVar

Copies the first variable into the second variable without

evaluation.

CopyVar(Var1,Var2)

correlation

Returns the correlation of the elements of a list or matrix.

correlation(List) or correlation(Matrix)

Example:

correlation

returns

count

Applies a function to the elements in a list or matrix and

returns their sum.

count(Function, List) or count(Function,
Matrix)

Example:

count((x→x,[2,12,45,3,7,78])

returns

147

covariance

Returns the covariance of the elements in a list or matrix.

covariance(List) or covariance(Matrix)

Example:

covariance

returns

1 2
1 1
4 7

33

6

31

-------------------

1 2
1 1
4 7

11

3

-------