fngendata function

Data generating function