hesnengr
Petroleum
- Aug 26, 2010
- 9
Hi all,
I am new to matlab and working to convert a matlab code into FORTRAN code.
I have problem in understanding the following syntax in matlab,
kn=10
i=30
su=0
lam=ones(j,kn+1,i,1)
for j=1:20
su=su+lam(j,kn+1,i,1)
end
In the above code lam is a 4-D matrix with four columns of different lengths having one (1) in each element.
when this is lam is added to su, how does it work (a scalar or acts like a matrix).
if any one can explain me with an example then will be grateful !!!
I am new to matlab and working to convert a matlab code into FORTRAN code.
I have problem in understanding the following syntax in matlab,
kn=10
i=30
su=0
lam=ones(j,kn+1,i,1)
for j=1:20
su=su+lam(j,kn+1,i,1)
end
In the above code lam is a 4-D matrix with four columns of different lengths having one (1) in each element.
when this is lam is added to su, how does it work (a scalar or acts like a matrix).
if any one can explain me with an example then will be grateful !!!