If you define a 3D heat source term the (SI) unit will be [W/m3], irrespective of the way its defined. Even if you use a pointwise user defined function, in each (x,y,z) point the heat source will be [W/m3] but can vary pointwise.
A heat source Q=1 (constant) and Q=myfunc(x,y,z) where
myfunc.m is defined as:
function res = myfunc(x,y,z)
res = ones(size(x));
are completely equivalent (with the exception that the constant is much faster to evaluate).