plot3d discrete problem



On Sat, 2011-02-19 at 12:46 +0000, Rob Burns wrote:
> This plot used to work in maxima 5.18.1 but does not now work.
> 
> (%i1) M: matrix([2, 2, 3, 5], [2, 1, 3, 2], [2, 2, 3, 4],
> 
>        [2, 2, 3, 3], [1,1,1,4])$
> (%i2) M;
> (%o2) matrix([2,2,3,5],[2,1,3,2],[2,2,3,4],[2,2,3,3],[1,1,1,4])
> (%i3) f(x, y) := float (M [?round(x), ?round(y)])$
> (%i4) plot3d (f, [x, 1, 5], [y, 1, 4], ['grid, 4, 4], ['xlabel, "x-axis"], 
> [plot_format, openmath])$

Hi Rob,
as explained in the manual, this example should be like this:

(%i1) M: matrix([1, 2, 3, 4], [1, 2, 3, 2], [1, 2, 3, 4],[1, 2, 3, 3])$
(%i2) f(x, y) := float('M [round(x round(y)])$
(%i3) plot3d (f(x,y), [x, 1, 4], [y, 1, 4], [grid, 4, 4], ['xlabel,
"x-axis"], [plot_format, openmath])$

you have to quote M in the definition of f and you can not call f(x,y)
just by its name in this case. There is now a round function defined in
Maxima, so you no longer have to use the lisp roud function.
Regards,
Jaime