it's been 5 hours and I'm trying to plot two graphs in matlab but in vain, here is my code
x = -pi:.1:pi;
z =(1/(2*pi))*exp(-power(x,2)/2);
y=((n.^(n/2))/fact(n-1))*((x + sqrt(n)).^(n-1))*exp(-sqrt(n)*(x + sqrt(n)));
plot(x,z,'color','r'); hold on;
plot(x,y,'color','b');
if there is an other page where I can ask this question please tell me !
For now, I can only see that you forgot to define
n. So, either you choosen=...or you do aforloop and varynfrom1..Nand define the upper boundN.Ok. Say
n=10. Your code will work like this:First,
n!isfactorialnotfactin MATLAB. Also, you forgot.*multiplication to do vector one by one multiplication.The above code should work.