StackOverflow 文档 Julia Language 教程 sub2ind 坑瀑布 坑瀑布 Created: November-22, 2018 placeholderCopy# no error, even the subscript is out of range. julia> sub2ind((3,3), 3, 4) 12通过比较索引,无法确定下标是否在数组范围内: placeholderCopyjulia> sub2ind((3,3), -1, 2) 2 julia> 0 < sub2ind((3,3), -1, 2) <= 9 true 将下标转换为线性索引