Scilab 5.5.0
- Справка Scilab
- API Scilab
- Low level functions
- AssignOutputVariable
- CallOverloadFunction
- CheckInputArgument
- CheckOutputArgument
- ReturnArguments
- Boolean reading (Scilab gateway)
- Boolean writing (Scilab gateway)
- Boolean sparse reading (Scilab gateway)
- Boolean sparse writing (Scilab gateway)
- Check variable dimensions (Scilab gateway)
- Variable Reference (Scilab gateway)
- Variable dimension (Scilab gateway)
- Variable Type (Scilab gateway)
- Variable Complexity (Scilab gateway)
- Matrix Type (Scilab gateway)
- deleteNamedVariable
- Double reading (Scilab gateway)
- Double writing (Scilab gateway)
- getNbInputArgument (Scilab gateway)
- getNbOutputArgument (Scilab gateway)
- Handle reading (Scilab gateway)
- Handle writing (Scilab gateway)
- Integer Precision (Scilab gateway)
- Integer reading (Scilab gateway)
- Integer writing (Scilab gateway)
- nbInputArgument (Scilab gateway)
- Pointer reading (Scilab gateway)
- Pointer writing (Scilab gateway)
- Polynomial Symbolic Variable (Scilab gateway)
- Polynomial reading (Scilab gateway)
- Polynomial writing (Scilab gateway)
- Sparse matrix reading (Scilab gateway)
- Sparse writing (Scilab gateway)
- String reading (Scilab gateway)
- String writing (Scilab gateway)
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.
ReturnArguments
A C gateway function which returns the various variables.
Calling Sequence
ReturnArguments(pvApiCtx);
Description
ReturnArguments(pvApiCtx) will return the various variables declared through AssignOutputVariable(pvApiCtx, X).
Examples
This example takes a matrix of doubles as input and returns:
the number of lines (first output argument)
the number of rows (second output argument)
#include "api_scilab.h" int sci_mysizedouble(char * fname, unsigned long fname_len) { SciErr sciErr; int m_in_row; int n_in_col; int* piAddr = NULL; double* pdblData = NULL; sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr); if(sciErr.iErr) { printError(&sciErr, 0); return 0; } /* get dimensions */ sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &m_in_row, &n_in_col, &pdblData); if(sciErr.iErr) { printError(&sciErr, 0); return 0; } sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx) + 1, 1, 1, &m_in_row); // the m_in_row parameter handles the number of lines of the matrix sent as argument sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx) + 2, 1, 1, &m_in_row); // store a same value, but will neither be used nor returned to Scilab sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx) + 3, 1, 1, &n_in_col); // the n_in_col parameter handles the number of columns of the matrix sent as argument AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1; // We set the parameter "nbInputArgument(pvApiCtx) + 1" as an output argument AssignOutputVariable(pvApiCtx, 2) = nbInputArgument(pvApiCtx) + 3; // We set the parameter "nbInputArgument(pvApiCtx) + 3" as an output argument ReturnArguments(pvApiCtx); return 0; }
Report an issue | ||
<< CheckOutputArgument | Low level functions | Boolean reading (Scilab gateway) >> |