summaryrefslogtreecommitdiff
path: root/modules/graphics/macros/eval3d.sci
diff options
context:
space:
mode:
authorShashank2017-05-29 12:40:26 +0530
committerShashank2017-05-29 12:40:26 +0530
commit0345245e860375a32c9a437c4a9d9cae807134e9 (patch)
treead51ecbfa7bcd3cc5f09834f1bb8c08feaa526a4 /modules/graphics/macros/eval3d.sci
downloadscilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.gz
scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.bz2
scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.zip
CMSCOPE changed
Diffstat (limited to 'modules/graphics/macros/eval3d.sci')
-rwxr-xr-xmodules/graphics/macros/eval3d.sci28
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/graphics/macros/eval3d.sci b/modules/graphics/macros/eval3d.sci
new file mode 100755
index 000000000..493cbcf64
--- /dev/null
+++ b/modules/graphics/macros/eval3d.sci
@@ -0,0 +1,28 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+function [z]=eval3d(fun,x,y)
+ //Etant donnee une discretisation des abscisses (x) et des ordonnees (y)
+ // eval3d(fun,x [,y]) retourne la matrice [fun(x(i),y(j))] des valeurs de la
+ // fonction decrite par la macro fun aux points (x(i),y(j)).
+ //Attention fun doit savoir gerer des arguments x et y vectoriels.
+ // Si fun ne sait pas gerer des arguments vectoriels, utiliser
+ // feval(x,y,fun)
+ //Si y n'est pas fourni il est suppose identique a x
+ //!
+ [lhs,rhs]=argn(0)
+ if rhs==3 then
+ nx=prod(size(x));ny=prod(size(y))
+ z=matrix(fun(ones(1,ny).*.matrix(x,1,nx),matrix(y,1,ny).*.ones(1,nx)),nx,ny)
+ elseif rhs==2 then
+ nx=prod(size(x))
+ z=matrix(fun(ones(1,nx).*.matrix(x,1,nx),matrix(x,1,nx).*.ones(1,nx)),nx,nx)
+ else
+ error(msprintf(gettext("%s: Wrong number of input arguments: %d or %d expected.\n"), "eval3d", 2, 3));
+ end
+endfunction