This is part of the HicEst documentation
FromTo Op ":" Select Subarrays or Substrings
Operator ":" provides a sub-array, or a sub-string for use in (InlineLoop-) expressions or in MatrixExplorer for partial file matrices.
⇾Home
⇾Contents
⇾more Programming
⇾ Examples
The FromTo operator ":" for
Arrays
:
REAL
:: rows=3, cols=4, length=5, X(length), A(rows,cols)
X =
$
1 2 3 4
X(3:4) = X(4:3)^2
1 2 16 9
A =
$
^2
1
4
9
16
25
36
49
64
81
100
121
144
A(2:3, 1:2) = -A(2:3, 1:2)
1
4
9
16
-25
-36
49
64
-81
-100
121
144
The FromTo operator ":" for
Strings
:
CHARACTER
alpha*8/"ABCDEFGH"/, beta*12
beta = alpha(3:)
CDEFGH
beta = alpha(2:4) & alpha(6:8)
BCDFGH
beta = alpha(8:1)
HGFEDCBA
The FromTo operator ":" in
InlineLoop
:
factorial = * (1 : 5)
1*2*3*4*
X = +( 1 :
$
)
1 3 6 10
sum = +(2^(0:-10))
1+1/2+1/
x = *(49:1) / (*(6:1)) / (*(49-6:1))
6 from 4
y = *(49:49-6+1) / (*(6:1))
49 choos
The FromTo operator ":" in
MatrixExplorer
(c.f.
InlineLoop
,
Join
):
string = && (filename( 5:7, 2))
string g
⇾
Support HicEst
⇾
Impressum
©2000-2019 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.