function viewhelp(Helpfield, posB, posF, posR, x)

for i=1:4
    if (posF(i,1) < x(1)) && (x(1) < posF(i,1)+posF(i,3)) && (posF(i,2) < x(2)) && (x(2) < posF(i,2)+posF(i,4))
        set(Helpfield(2), 'String', 'Open this plot in a new figure window by right click.');
        return;
    end
end

if (posB(1,1) < x(1)) && (x(1) < posB(1,1)+posB(1,3)) && (posB(1,2) < x(2)) && (x(2) < posB(1,2)+posB(1,4))
    set(Helpfield(2), 'String', 'Load mat-file containing data matrix D (spectra  x channels).');
    return;
elseif (posB(2,1) < x(1)) && (x(1) < posB(2,1)+posB(2,3)) && (posB(2,2) < x(2)) && (x(2) < posB(2,2)+posB(2,4))
    set(Helpfield(2), 'String', 'Transpose the data matrix.');
    return;
elseif (posB(3,1) < x(1)) && (x(1) < posB(3,1)+posB(3,3)) && (posB(3,2) < x(2)) && (x(2) < posB(3,2)+posB(3,4))
    set(Helpfield(2), 'String', 'Compute an initial NMF.');
    return;
elseif (posB(4,1) < x(1)) && (x(1) < posB(4,1)+posB(4,3)) && (posB(4,2) < x(2)) && (x(2) < posB(4,2)+posB(4,4))
    set(Helpfield(2), 'String', 'Show initial factors C and A.');
    return;
elseif (posB(5,1) < x(1)) && (x(1) < posB(5,1)+posB(5,3)) && (posB(5,2) < x(2)) && (x(2) < posB(5,2)+posB(5,4))
    set(Helpfield(2), 'String', 'Show initial factor C.');
    return;
elseif (posB(6,1) < x(1)) && (x(1) < posB(6,1)+posB(6,3)) && (posB(6,2) < x(2)) && (x(2) < posB(6,2)+posB(6,4))
    set(Helpfield(2), 'String', 'Show initial factor A.');
    return;
elseif (posB(7,1) < x(1)) && (x(1) < posB(7,1)+posB(7,3)) && (posB(7,2) < x(2)) && (x(2) < posB(7,2)+posB(7,4))
    set(Helpfield(2), 'String', 'Compute the AFS.');
    return;
elseif (posB(8,1) < x(1)) && (x(1) < posB(8,1)+posB(8,3)) && (posB(8,2) < x(2)) && (x(2) < posB(8,2)+posB(8,4))
    set(Helpfield(2), 'String', 'Show the factors for segment 1 of the AFS (blue or black).');
    return;
elseif (posB(9,1) < x(1)) && (x(1) < posB(9,1)+posB(9,3)) && (posB(9,2) < x(2)) && (x(2) < posB(9,2)+posB(9,4))
    set(Helpfield(2), 'String', 'Show the factors for segment 2 of the AFS (green).');
    return;
elseif (posB(10,1) < x(1)) && (x(1) < posB(10,1)+posB(10,3)) && (posB(10,2) < x(2)) && (x(2) < posB(10,2)+posB(10,4))
    set(Helpfield(2), 'String', 'Show the factors for segment 3 of the AFS (red).');
    return;
elseif (posB(11,1) < x(1)) && (x(1) < posB(11,1)+posB(11,3)) && (posB(11,2) < x(2)) && (x(2) < posB(11,2)+posB(11,4))
    set(Helpfield(2), 'String', 'Save only the AFS (abstract NMF + AFS) in .mat-file.');
    return;
elseif (posB(12,1) < x(1)) && (x(1) < posB(12,1)+posB(12,3)) && (posB(12,2) < x(2)) && (x(2) < posB(12,2)+posB(12,4))
    set(Helpfield(2), 'String', 'Save all results in .mat-file.');
    return;
elseif (posB(13,1) < x(1)) && (x(1) < posB(13,1)+posB(13,3)) && (posB(13,2) < x(2)) && (x(2) < posB(13,2)+posB(13,4))
    set(Helpfield(2), 'String', 'Compute reduced AFS after locking a point.');
    return;
elseif (posB(14,1) < x(1)) && (x(1) < posB(14,1)+posB(14,3)) && (posB(14,2) < x(2)) && (x(2) < posB(14,2)+posB(14,4))
    set(Helpfield(2), 'String', 'Compute doubly-reduced AFS after locking two points.');
    return;
elseif (posB(15,1) < x(1)) && (x(1) < posB(15,1)+posB(15,3)) && (posB(15,2) < x(2)) && (x(2) < posB(15,2)+posB(15,4))
    set(Helpfield(2), 'String', 'Remove locked point(s) and reduced AFS.');
    return;
elseif (posB(16,1) < x(1)) && (x(1) < posB(16,1)+posB(16,3)) && (posB(16,2) < x(2)) && (x(2) < posB(16,2)+posB(16,4))
    set(Helpfield(2), 'String', 'Remove only the second locked point and its AFS.');
    return;
end

if (posR(1,1) < x(1)) && (x(1) < posR(1,1)+posR(1,3)) && (posR(1,2) < x(2)) && (x(2) < posR(1,2)+posR(1,4))
    set(Helpfield(2), 'String', 'Select the no of components, see singular values.');
    return;
elseif (posR(2,1) < x(1)) && (x(1) < posR(2,1)+posR(2,3)) && (posR(2,2) < x(2)) && (x(2) < posR(2,2)+posR(2,4))
    set(Helpfield(2), 'String', 'Select "Pol-infl" for 3 parts and "Invers-pol-infl" otherwise.');
    return;
elseif (posR(3,1) < x(1)) && (x(1) < posR(3,1)+posR(3,3)) && (posR(3,2) < x(2)) && (x(2) < posR(3,2)+posR(3,4))
    set(Helpfield(2), 'String', 'Activate live-view mode and move mouse pointer through the AFS.');
    return;
end
    
set(Helpfield(2), 'String', '');