Question: Help with plotting

Hi Guys, I hope you can help!

I am stuck trying to plot a function that has a conditional based on 'x' the plotted variable.

e.g.

> pltx := proc (num1::integer, num2::integer, x) 
if 1 < x then
return 0
elif x < 0 then
return 0
else
return num1*x^num2
end if
end proc;

> d := plot(pltx(2, 5, x), x = 0.1 .. 0.4);

Error, (in pltx) cannot determine if this expression is true or false: 1 < x
>

 Does anyone know, why this happens and how I can fix it?

 

Please Wait...