From: Pierre C. <pie...@ac...> - 2024-04-06 15:33:12
|
Hello I'd like to draw a stair function to illustrate what we called in france "Méthode des rectangles" : I try this : f(x):=1/(1+x); E(f,x,n,a,b):=block( if x=b then return(f(b)) else for i:1 thru n do if (x < a+i*(b-a)/n) then return(f(a+(i-1)/n)) ); E(f,0.19,10,0,1); E(f,1,10,0,1); E(f,0,10,0,1); But wxplot2d([f(x),E(f,x,10,0,1)], [x,0,1])$ give me an error : COERCE-FLOAT-FUN: no such Lisp or Maxima function: done any idea to produce the function may be with no evaluation on each x ? Thx |