I have tried the following command and it works.
set(gcf, 'color', 'white');
In the command, "gcf" is "Current figure handle".
As for transparent background, you can change 'white' to 'none', but the background may display as black. I think it is because gif file does not support alpha channel as png does.