logo
  • 教程列表
  • SO官方文档
  • sub2ind
    • 将下标转换为线性索引
    • 坑瀑布
  1. StackOverflow 文档
  2. Julia Language 教程
  3. sub2ind
  4. 坑瀑布

坑瀑布

Created: November-22, 2018

# no error, even the subscript is out of range.
julia> sub2ind((3,3), 3, 4)
12

通过比较索引,无法确定下标是否在数组范围内:

julia> sub2ind((3,3), -1, 2)
2

julia> 0 < sub2ind((3,3), -1, 2) <= 9
true
  • 将下标转换为线性索引

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明