Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - 日本語

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

Manual Scilab >> call_scilab API > call_scilab


call_scilab is an interface which provides the ability to call Scilab engine from C/C++ code


Scilab offers the possibility to be called from a native (C/C++) application.

Thanks to this module, it is possible to call Scilab from C/C++ in order to interface Scilab's features from an other code/application or to be able to interface Scilab's features from an other language.

Since Scilab 5.2.0, all Scilab datatype can be handle by call_scilab. This is done thanks to API_Scilab

This help describes the features of the call_scilab API.

Note: The javasci module is based on call_scilab.

Note: old APIs (stackX.h) will not be available after Scilab 6.0 (included).


// A simple call_scilab example 

#include <stdio.h> /* stderr */

#include "stack-c.h" /* Provide functions to access to the memory of Scilab */
#include "call_scilab.h" /* Provide functions to call Scilab engine */

// Filename: simple_call_scilab.c

int main(void)
/****** INITIALIZATION **********/
#ifdef _MSC_VER
 if ( StartScilab(NULL,NULL,NULL) == FALSE )
 if ( StartScilab(getenv("SCI"),NULL,NULL) == FALSE )
   fprintf(stderr,"Error while calling StartScilab\n");
   return -1;

/****** ACTUAL Scilab TASKS *******/

 SendScilabJob("myMatrix=['sample','for the help']");
 SendScilabJob("disp(myMatrix);"); // Will display !sample  for the help  !
 SendScilabJob("disp([2,3]+[-44,39]);"); // Will display   - 42.    42.  

/****** TERMINATION **********/
 if ( TerminateScilab(NULL) == FALSE ) {
  fprintf(stderr,"Error while calling TerminateScilab\n");
  return -2;
 return 0;


Sylvestre Ledru

Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Jan 26 16:24:43 CET 2011