next up previous contents
Next: Where Construct Up: Arrays Previous: Deallocating Arrays

 

Masked Array Assignment - Where Statement

This is achieved using WHERE:

    WHERE (I .NE. 0) A = B/I

the LHS of the assignment must be array valued and the mask, (the logical expression,) and the RHS of the assignment must all conform;

For example, if

displaymath27227

and,

displaymath27228

then

displaymath27229

Only the indicated elements, corresponding to the non-zero elements of I, have been assigned to.

For more information, click here gif

Now try this question gif


next up previous contents
Next: Where Construct Up: Arrays Previous: Deallocating Arrays

©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997
Not for commercial use.