I want to put constraints to this uniform distribution function,
f(x)=1/2 if 2<=x<=4, 0 otherwise
I am asked to write my own uniform distribution function, so I can't use the in built function.
I'm using syms so as to plot, but when I use the if statement it says "conversion of syms to logical form is not possible". I want to make a pdf but the only result I need is the graph.
Thank You, all the three functions are right. I do not know which one to choose as the best answer.
Best Answer