How to generate a sample from $p(x)$? Let's first see how Matlab samples from a $p(x)$. In Matlab, there are several common probability distributions. Try univariate Gaussian distribution p= normpdf(linspace(xmin , xmax , num_of_points) , mean, stand…