values of a function on a grid
[z]=eval3d(fun,x,[y])
function accepting vectors as arguments.
2 vectors of size (1,n1) and (1,n2). (default value for y
: y=x
).
matrix of size (n1,n2).
This function returns a matrix z(n1,n2)
. z(i,j)=fun(x(i),y(j))
.
If the function fun
does not accept arguments of type vector use the
primitive feval
.
x=-5:5;y=x; deff('[z]=f(x,y)',['z= x.*y']); z=eval3d(f,x,y); plot3d(x,y,z); deff('[z]=f(x,y)',['z= x*y']); z=feval(x,y,f); plot3d(x,y,z); | ![]() | ![]() |
Version | Description |
6.0.2 | Last Scilab version supporting eval3d .
[X,Y]=ndgrid(x,y); Z=fun(X,Y);
may replaces it. |