An apostrophe, or rather a single quote as it is called, in a string can be accomplished by doubling it, like in:
More importantly, you do not want to use eval at all, by designing your variables a little bit more clever using, e.g., cell arrays or structs.
B(1).values = sinc(x).*sinc(y);
B(2).values = sinc(2x).*sinc(2y);
for k = 1:numel(B)
filename = sprintf('B_%d.bmp',k)
This away you avoid all the complications induced by eval ...