COLON

From Jacket Wiki

Jump to: navigation, search
Back to Function List

Create vectors, array subscripting, and for-loop iterators

Usage

Jacket for M Language
    Supported Syntax
    
j:k % is the same as [j,j+1,...,k], or empty when j > k.
j:i:k % is the same as [j,j+i,j+2i, ...,j+m*i], where m = fix((k-j)/i), for integer values.
A(:,j) % is the jth column of A.
A(i,:) % is the ith row of A.
A(:,:) % is the equivalent two-dimensional array. For matrices this is the same as A.
A(j:k) % is A(j), A(j+1),...,A(k).
A(:,j:k) % is A(:,j), A(:,j+1),...,A(:,k).
A(:,:,k) % is the kth page of three-dimensional array A.
A(i,j,k,:) % is a vector in four-dimensional array A. The vector includes A(i,j,k,1), A(i,j,k,2), A(i,j,k,3), and so on.
A(:) % is all the elements of A, regarded as a single column.
 
% new in v1.7: last parameter is class name
colon(..,class(x))  % where x is some other GPU variable
colon(..,gsingle)  % explicitly name the type
colon(..,gdouble)
    

GFOR Supported

No

GCOMPILE Supported

No

Types Supported

-  GDOUBLE   GSINGLE   GLOGICAL   GINT32   GINT8   GUINT32   GUINT8   COMPLEX 

Types Not Supported

-

CPU usageJacket only contains GPU computing functions. To run functions on the CPU, try one of the MathWorks products:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/colon.html
More Details


See Also

FOR, LINSPACE, LOGSPACE, RESHAPE

Views
Personal tools