Multidimensional Array Comprehension in Julia

后端 未结 7 1265
既然无缘
既然无缘 2021-01-11 12:50

I\'m mucking about with Julia and can\'t seem to get multidimensional array comprehensions to work. I\'m using a nightly build of 0.20-pre for OSX; this could conceivably be

相关标签:
7条回答
  • 2021-01-11 13:18

    This is another (albeit convoluted) way:

    x1 = 1
    x2 = 5
    
    y1 = 6
    y2 = 10
    
    x = [x for x in x1:x2, y in y1:y2]
    y = [y for x in x1:x2, y in y1:y2]
    
    xy = cat(2,x[:],y[:])
    
    0 讨论(0)
提交回复
热议问题