Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.0 - Русский

Change language to:
English - 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 >> Функции > Библиотеки > lib


library definition


namelib = lib('lib-dir')



character string


library variable returned by 'lib'.


lib-dir is a character string defining a directory that contains compiled Scilab function (.bin) files.

In addition to these files lib-dir must have a file called names, that contains the names of the functions defined in lib-dir. On success, all functions in lib-dir are available from within Scilab. They are loaded on demand when called for the first time.

Binary files can be created from within Scilab with the command save. A library variable usually is saved for later loading, either on-line or from the user-specific startup file (see startup).

value returned by 'lib' must be insert in a variable 'namelib' to access to macro functions of this library.


Scilab tacitly assumes that each xxxx.bin file defines a variable named xxxx.


//define some functions
function z=myplus(x, y)
  z = x + y

function z=yourplus(x, y)
  x = x - y

//create the *.bin files in libdir
libdir = TMPDIR;
save(libdir + '/myplus.bin', myplus);
save(libdir + '/yourplus.bin', yourplus);

//create the name file

//build the library containing myplus and yourplus
mylibfoo = lib(libdir+'/');

//erase the variables
clear myplus yourplus

//Automatic loading and execution

//erase the variables
clear myplus yourplus

[n,p] = libraryinfo('mylibfoo')

clear mylibfoo

See also

  • library — library datatype description
  • genlib — build library from functions in given directory
  • save — Save a variable or a serie of variables in a binary file
  • deff — определение функции во время выполнения программы
  • exec — исполнение файла-сценария
  • whereis — name of library containing a function
  • libraryinfo — get macros and path of a scilab library
Report an issue
<< get_function_path Библиотеки librarieslist >>

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:
Tue Feb 14 15:13:37 CET 2017