Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A question about notation

Status
Not open for further replies.

playmobil

Technical User
Jan 8, 2016
2
MX
Hi guys

I am trying to understand a code from a book (I write few lines).

DO
f(1, :) = Fcn(x, y)
DO i=2, s
w = y + h*MATMUL(a(i, 1:i-1), f(1:i-1, :))
f(i, :) = Fcn(x + c(i)*k, w)
END DO
END DO

It is clear for me the meaning of a(i, 1:i-1) but i did not find anything for f(1, :), that is, when you have only :

Thanks in advance
 
The syntax is basically
Code:
array([start]:[end][:step=1],...)
where the items in [] are optional. So if f has been declared as f(-10:10,-9:9) it means f(1,-9:9)

You can do some pretty complicated stuff with this notation that you can't in any other language. For instance, you could assign all the odd members of an array to all the even elements of another array. It is basically an implied loop
Code:
integer::evens(20), odds(19)
...
evens(2::2) = odds(1::2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top