Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.1 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2024.1.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Advanced functions > Built-in & external > newfun


add a name in the table of functions

Calling Sequence

newfun(function_name, function_ptr)



a character string, giving a valid function name


a positive number with integer value (see below)


Utility function (for experts only).

Adds the name function_name in the table of functions known to the interpreter.

function_ptr is an integer 1000*fun+fin where fun and fin are the internal coding of the primitive function_name.

This function may be useful to associate a primitive to a gateway called in "gw_user.c" (fun=14). Note however that the ilib_build function is a more easy way to extend Scilab with new functions based on C, C++ or Fortran code.

This function may also be used to add an alias or to rename to an existing primitive function.

Used with funptr and clearfun one can add an alias or rename an existing primitive function.


absptr=funptr("abs");// get the function_ptr associated with the abs function
newfun("abs_bis",absptr) // create an alias of the abs function
clearfun("abs") // remove abs as a known function

 //redefine abs
 function y=abs(x)

See Also

  • clearfun — removes primitive
  • funptr — coding of primitives ( wizard stuff )
  • ilib_build — utility for shared library management
Report an issue
<< intppty Built-in & external readgateway >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Oct 02 13:47:02 CEST 2014