Question: Why don't the sliders work?

Hi, 

Moving the sliders clean the plot.
Does any one can show me how to fix this (PS: this piece of code is a part of a procedure whose arguments are RV and SliderRanges and I need this unusual coding to make the procedure generic ... at least I guess so)

Thanks in advance


 

restart:

interface(version);

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

with(Statistics):

RV   := RandomVariable(Normal(a, b)):
law  := [attributes(RV)][3]:
pars := law:-Parameters;

[a, b]

(2)

SliderRanges := [-5.0..5.0, 1.0..3.0]:
[seq(pars[k]=SliderRanges[k], k=1..numelems(pars))]

[a = -5.0 .. 5.0, b = 1.0 .. 3.0]

(3)

f := PDF(RV, x);
# Explore(plot(f, x=-3..3), parameters=[seq(pars[k]=SliderRanges[k], k=1..numelems(pars))]);

(1/2)*2^(1/2)*exp(-(1/2)*(x-a)^2/b^2)/(Pi^(1/2)*b)

(4)

 


 

Download Explore_Problem.mw

Please Wait...