- Manuel Scilab
- API Scilab
- Scilab Gateway API
- How to
- CheckColumn
- CheckDimProp
- CheckDims
- CheckLength
- CheckLhs
- CheckRhs
- CheckRow
- CheckSameDims
- CheckScalar
- CheckSquare
- CheckVector
- CreateListVarFrom
- CreateListVarFromPtr
- CreateVar
- FindOpt
- FirstOpt
- GetListRhsVar
- GetRhsVar
- GetType
- IsOpt
- Lhs
- LhsVar
- NumOpt
- OverLoad
- Rhs
- Scierror
- Scilab C Types
- get_optionals
- istk
- sci_types
- sciprint
- stk
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
However, this page did not exist in the previous stable version.
GetRhsVar
a C gateway function which allows to access an argument transmitted to a Scilab function
Calling Sequence
GetRhsVar(StackPos, Type, &m_rows, &n_cols, &l_stack_pos);
Arguments
- StackPos
The rank of the variable to be accessed (input argument)
- Type
The Scilab C Type of the parameter to be accessed (input argument).
STRING_DATATYPE "c"
MATRIX_OF_STRING_DATATYPE "S"
MATRIX_OF_DOUBLE_DATATYPE "d"
MATRIX_OF_RATIONAL_DATATYPE "r"
MATRIX_OF_VARIABLE_SIZE_INTEGER_DATATYPE "I"
MATRIX_OF_INTEGER_DATATYPE "i"
MATRIX_OF_BOOLEAN_DATATYPE "b"
MATRIX_OF_COMPLEX_DATATYPE "z"
SPARSE_MATRIX_DATATYPE "s"
TYPED_LIST_DATATYPE "t"
MATRIX_ORIENTED_TYPED_LIST_DATATYPE "m"
SCILAB_POINTER_DATATYPE "p"
GRAPHICAL_HANDLE_DATATYPE "h"
EXTERNAL_DATATYPE "f"
MATRIX_OF_POLYNOMIAL_DATATYPE "x"
- m_rows
the number of lines of the accessed parameter (output argument)
- n_cols
the number of columns of the accessed parameter (output argument)
- l_stack_pos
the position in the Scilab memory of the accessed parameter (output argument)
Description
A C gateway function which allows to access a argument transmitted to a Scilab function
WARNING: This API is deprecated from Scilab 5.2.0 and is going to be removed with Scilab 6.0. Please use API Scilab (the new Scilab API).
Examples
In this example, the function has two input arguments:
the number of columns (first argument)
the number of lines (second argument)
The goal of this function is to created a matrix of integers equal to 1.
#include <stack-c.h> #include <string.h> int sci_myones(char * fname) { int m_param_1, n_param_1, l_param_1; int m_param_2, n_param_2, l_param_2; int m_out_row, n_out_col, l_out_pos; int i; int * pOutPos = NULL; GetRhsVar(1, MATRIX_OF_INTEGER_DATATYPE, &m_param_1, &n_param_1, &l_param_1); GetRhsVar(2, MATRIX_OF_INTEGER_DATATYPE, &m_param_2, &n_param_2, &l_param_2); // We create a matrix of ints equal to 1 m_out_row = *istk(l_param_1); // The first dimension of the matrix to be created // is stored in the first input parameter n_out_col = *istk(l_param_2); // The second dimension of the matrix to be created // is stored in the second input parameter CreateVar(3, MATRIX_OF_INTEGER_DATATYPE, &m_out_row, &n_out_col, &l_out_pos); pOutPos = istk(l_out_pos); // Get a pointer to the area allocated by CreateVar (a pointer to an integer) for(i=0;i<m_out_row*n_out_row;i++) pOutPos[i] = 1; // A concise way to write the preceding line of code: // for(i=0;i<m_out_row*n_out_row;i++) *istk(l_out_pos+i) = 1; LhsVar(1) = 3; // We return the 3rd Scilab variable of our gateway return 0; }
See Also
<< GetListRhsVar | Scilab Gateway API | GetType >> |