Hi Wen,
In NCL you do it as follow:
Ifind = ind ( A .gt. 10.0)
A(Ifind) = 100.0
very easy also!
Mateus
wenlong_at_hpl.umces.edu escreveu:
> Hi all,
>
> I'm starting to learn NCL.
>
> Once thing I'd like to do is to set part of an array to a value I
> want. In matlab is is really eazy:
>
> Say A(1:100,1:200) is a 2D float array,
>
> I can do the following to set all locations with value >10 to 100.0
>
> %----matlab----
> Ifind=find(A>10.0); %find the indices that statisfy the condition
> A(Ifind) =100.0; %reset the value to 100.0
> %--------------
>
> Is there a fast way to do this in NCL? I mean, I really don't
> want to use tedious do loops.
>
>
> Thanks
>
> Wen
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 13 2007 - 12:19:54 MST
This archive was generated by hypermail 2.2.0 : Tue Feb 13 2007 - 14:07:37 MST