In Matlab I have a vector
x =
1 2 3 2 2 6
and I get
» y=find(x==2)
y =
2 4 5
How to do this in Fortran 90/95 without do loop?
Something like this ?
forall (i=1:6, x(i)==2)
y(i)=i
y=pack(y,y/=0)
end forall
Regards
Juhani Bastman
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|