This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Fusion of two matrices or arrays


C = wfusmat(A,B,METHOD)


C = wfusmat(A,B,METHOD) returns the fused matrix C obtained from the matrices A and B using the fusion method defined by METHOD.

The matrices A and B must be of the same size. The output matrix C is of the same size as A and B.

Available fusion methods are

  • Simple, where METHOD is

    • 'max' : D = abs(A) abs(B) ; C = A(D) + B(~D)

    • 'min' : D = abs(A) abs(B) ; C = A(D) + B(~D)

    • 'mean' : C = (A+B) / 2 ; D = ones(size(A))

    • 'rand' : C = A(D) + B(~D); D is a Boolean random matrix

    • 'img1' : C = A

    • 'img2' : C = B

  • Parameter-dependent, where METHOD is of the following form:

    METHOD = struct('name',nameMETH,'param',paramMETH)

    where nameMETH can be

    • 'linear' : C = A*paramMETH + B*(1-paramMETH),

      where 0 £ paramMETH 1

    • 'UD_fusion': Up-down fusion, with paramMETH ≥ 0

      x = linspace(0,1,size(A,1));
      P = x.^paramMETH;

    Then each row of C is computed with

    C(i,:) = A(i,:)*(1-P(i)) + B(i,:)*P(i); 
    So C(1,:) = A(1,:) and C(end,:) = A(end,:) 
    • 'DU_fusion': Down-up fusion

    • 'LR_fusion': Left-right fusion (columnwise fusion)

    • 'RL_fusion': Right-left fusion (columnwise fusion)

    • 'UserDEF': User-defined fusion, paramMETH is a character vector 'userFUNCTION' containing a function name such that C = userFUNCTION(A,B).

In addition, [C,D] = wfusmat(A,B,METHOD) returns the Boolean matrix D when defined, or an empty matrix otherwise.

Introduced before R2006a

Was this topic helpful?