Personally, I find simple two-parameter linear brightness/contrast adjustment to be frustratingly inflexible, but it's popular in image editing software for the simplicity.
This is basically how GIMP/GEGL does it:
A = im2double(imread('pout.tif'));
B = B + (1-B)*brightness;
th = tan((contrast+1)*pi/4);
You will note that this implements a simple linear curve. This will push values below 0 or above 1. If those values don't need to be retained for further processing (e.g. if the image is to be exported), it may be a good idea to clamp the results.
In other words, with the above parameters, the transfer curve between A and B looks like this. Note supramaximal and subminimal values on the output:
But applying a simple clamping routine gives something like this.
There may be other ways to come up with two-parameter methods. For graphical work, slope discontinuities like those in the above curve are often undesirable, as they create noticeable banding in smooth images. I'm more used to doing this with arbitrary curves instead of endpoints or brightness/contrast. When in MATLAB, I tend to use a levels + gamma + contrast approach which often can be further reduced to a two-parameter nonlinear method if I'm feeling lazy.
A = im2double(imread('pout.tif'));
B = applycontrast(B,contrast);
function R = applycontrast(I,k)
R(lo) = 0.5*((1/c)*I(lo)).^kk;
R(hi) = 1-0.5*((1-I(hi))*(1/(1-c))).^pp;
The above operation has a smooth transfer curve and keeps values in-range.
As I mentioned, I tend to do contrast/brightness adjustment via a combination of input/output levels adjustment (linear) plus the above nonlinear gamma/contrast parameters. This is a 6-parameter approach and is the core of the MIMT tool imlnc() and the corresponding functionality of immodify(). The same can be done simply by using the above contrast function in addition to imadjust(). B = imadjust(A,inlevels,outlevels,gamma);
B = applycontrast(B,contrast);
If no nonlinear contrast behavior is desired, imadjust() should suffice by itself.
Aside from all of these methods, it's worth noting that your use of imagesc() implicitly performs a linear transformation equivalent to a contrast adjustment before the user adjusts anything. To be clear, this transformation doesn't change the image in CData, but it changes the displayed image, altering what the user sees. If your goal is to allow the user to arbitrarily adjust the contrast of an image, why would you start from anything other than the original, unaltered image? You're probably better off using imshow() or image(), though you may need to set certain options.
As far as your last question, it depends what you mean by "black & white". If you mean to convert a color image to grayscale, rgb2gray() should work. If you want to convert it to a binary image (containing only black or white, with no gray levels between), then you can try to use imbinarize(), but you're going to have trouble getting practical results unless you allow for a means to configure the optional arguments used by imbinarize().
Either way, it's unclear if your button callback is going to target the intended axes when it calls imshow(). If you intend for it to be displayed in the same axes as the other image, you'll have to do what needs to be done to do so.