COLON
From Jacket Wiki
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) |
|||||||||||||
|
|||||||||||||