阅读背景:

如何在朱莉娅的for循环中实现5维数组?

来源:互联网 
function prealloc()
    situation=zeros(Int64,3^5,5);
    i=1;
    for north=0:2
        for south=0:2
            for east=0:2
                for west=0:2
                    for current=0:2
                        situation[i,:]=[north, south, east, west, current]
                        i+=1
                    end
                end
            end
        end
    end
    situation
end
prealloc()
function prealloc()
    situation=zeros(Int64,3



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: