朱莉娅:如何获取数组的一部分

Nic*_*ler 1 arrays julia

获取数组的一部分的最有效(Julia)方法是什么?请记住 Julia 索引从 1 而不是 0 开始

>>> myArray = [1,2,3,4,5,6,7,8]
>>> #from an index to the last index?
>>> myArray[4th to last]
[4,5,6,7,8]
>>> #from an index to another index?
>>> myArray[3rd to 5th]
[3,4,5]
Run Code Online (Sandbox Code Playgroud)