MATLAB has no image viewer which can conveniently handle isolated display of transparent images. If you try to display the image using the 'alphadata' property of the image object, the result you get will simply be the image composed with whatever the axes background color is (probably white). That usually makes it difficult to impossible to tell the difference between white areas and transparent areas. .
MIMT does have tools and a viewer that support RGBA images. You'll still have to usually work around imread()/imwrite(), though.
That said, if you just want to compose the image to eliminate the alpha channel, then it depends what the background is to be.
[inpict,~,alpha] = imread('peppers_rgba.png');
hi = imshow(inpict,'border','tight');
Again, doing in-figure composition is problematic and cumbersome. Just do the composition outside the figure.
outpict1 = (1-mask).*permute(BG,[1 3 2]) + mask.*im2double(inpict);
outpict1 = im2uint8(outpict1);
imshow(outpict1,'border','tight')
Okay, that's more flexible, but it's still cumbersome, and it's still hard to tell the difference between transparent regions and opaque regions with the same color as the background. That's why image editors use some sort of matting to help make transparent regions visually distinct.
xx = mod(0:(sout(2)-1),squaresize(2)*2)<squaresize(2);
yy = mod(0:(sout(1)-1),squaresize(1)*2)<squaresize(1);
BG = im2double(0.3 + bsxfun(@xor,xx,yy')*0.4);
outpict2 = (1-mask).*BG + mask.*im2double(inpict);
outpict2 = im2uint8(outpict2);
imshow(outpict2,'border','tight')
Okay, that's helpful, but it's still cumbersome. If adding an extra parameter to an image()/imshow() call is annoying, this is just ridiculous.
Again, MIMT has tools for doing this succinctly. The three examples given can be reduced:
[inpict,~,alpha] = imread('peppers_rgba.png');
rgbapict = joinalpha(inpict,alpha);
outpict1 = replacepixels(inpict,BG,alpha);
outpict2 = alphasafe(joinalpha(inpict,alpha));
There are several threads on the topic. Bear in mind though, that the composed image contains less information than the image with its alpha intact. They are not equivalent, so if you're just doing this for the sake of MATLAB's limited image viewer, then you're probably shooting yourself in the foot.