2D array concatenation in fortran

后端 未结 3 1811
误落风尘
误落风尘 2021-01-22 04:16

Fortran 2003 has square bracket syntax for array concatenation, Intel fortran compiler supports it too. I wrote a simple code here for matrix concatenation:

prog         


        
3条回答
  •  萌比男神i
    2021-01-22 04:49

    Another way could simply be to

    mat3(:,1:3) = mat1
    mat3(:,4:6) = mat2
    

    I dont know which is faster, this or the do loop above...

提交回复
热议问题