|
On 10/31/2012 3:44 PM, Anita S wrote:
> Hello,
> I have 2 masks (both 128 X 128). The values in these matrices vary from 0-1.
...
> I basically need some value in this combined mask when both of the
> original masks have a value. If either of the masks have a zero, then
> the combined mask should have a zero in the equivalent column/row.
...
Isn't that a logical 'or' operation w/, perhaps some adjustment to final
values? If all you need is the True/False indication then or is all you
need; if you want a selection from A or B (have to decide which or some
other thing like an average if both are nonzero) then you need two steps
of A(A~-0) | B(B~=0) to pick the values from each. Excepting, of
course, you'll have to use an indexing operation since A(A~-0) will
return a column vector of values so you do need the index to subscript
step to place in correct location in the array.
--
|