vincent1984
Technical User
Hi,
I am new to fortran programming. I am trying to convert the following matlab code to fortran. Can somebody help? Thanks!
si = 1; k = 1;
for i = 1:30
for j = 1:10
ZL(k,si:si+2) = [1, 0, 2];
k = k+1;
end
si = si+3;
end
What I did was trying to 3 dimensions arrays. But kinda lost halfway.
program test
real(kind=2), dimension, :: ZL
si=1
k=1
do i = 1,30
do j = 1,10
ZL(k,si) = 1
ZL(k,si+1) = 0
ZL(k,si+2) = 2
k=k+1
end do
si=si+3
end do
end program test
Many thanks for your help.
Vincent
I am new to fortran programming. I am trying to convert the following matlab code to fortran. Can somebody help? Thanks!
si = 1; k = 1;
for i = 1:30
for j = 1:10
ZL(k,si:si+2) = [1, 0, 2];
k = k+1;
end
si = si+3;
end
What I did was trying to 3 dimensions arrays. But kinda lost halfway.
program test
real(kind=2), dimension, :: ZL
si=1
k=1
do i = 1,30
do j = 1,10
ZL(k,si) = 1
ZL(k,si+1) = 0
ZL(k,si+2) = 2
k=k+1
end do
si=si+3
end do
end program test
Many thanks for your help.
Vincent