from latex_trick.m by Christopher Granade
Replaces decimal points in either a matrix or a scalar with a '&' to allow for easier handling

sout=latex_trick(nin, format)
function sout=latex_trick(nin, format)
    if length(nin(:)) == 1
        sout = sprintf(format, nin);
        cut = length(int2str(nin)) + 1;
        sout = [sout(1:(cut-1)) '&' sout((cut+1):max(size(sout)))];
    else
        sout = cell(size(nin));
        for i = 1:1:length(nin(:))
            sout{i} = latex_trick(nin(i), format);
        end
    end
return

Contact us at files@mathworks.com