Scilab 5.4.1
- Ajuda 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)
- Integer Precision (Scilab gateway)
- Integer reading (Scilab gateway)
- Integer writing (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.
String writing (Scilab gateway)
How to write matrices of string in a gateway.
Calling Sequence
Input argument profile:
SciErr createMatrixOfString(void* _pvCtx, int _iVar, int _iRows, int _iCols, const char* const* _pstStrings)
SciErr createMatrixOfWideString(void* _pvCtx, int _iVar, int _iRows, int _iCols, const wchar_t* const* _pwstStrings)
Named variable profile:
SciErr createNamedMatrixOfString(void* _pvCtx, const char* _pstName, int _iRows, int _iCols, const char* const* _pstStrings)
SciErr createNamedMatrixOfWideString(void* _pvCtx, const char* _pstName, int _iRows, int _iCols, const wchar_t* const* _pwstStrings)
Arguments
- _pvCtx
Scilab environment pointer, pass in "pvApiCtx" provided by api_scilab.h.
- _iVar
Position in the Scilab memory where you want to put the variable
- _pstName
Name of the variable for "named" functions.
- _iRows
Number of rows of the new variable
- _iCols
Numbers of columns of the new variable
- _pstStrings
Address of array of char* (size: _iCols * _iRows)
- SciErr
Error structure where is stored errors messages history and first error number.
Description
This help describes how matrix of strings can be handled through the Scilab API.
Gateway Source
#include "api_scilab.h" int write_string(char *fname,unsigned long fname_len) { SciErr sciErr; //variable info : matrix of string 2 x 3 int iRows = 2; int iCols = 3; char** pstData = NULL; //data to put in the new variable char string11[] = "may"; char string21[] = "be"; char string12[] = "the"; char string22[] = "with"; char string13[] = "puffin"; char string23[] = "you"; //alloc new array pstData = (char**)malloc(sizeof(char*) * iRows * iCols); //copy data address to the "main" array pstData[0] = string11; pstData[1] = string21; pstData[2] = string12; pstData[3] = string22; pstData[4] = string13; pstData[5] = string23; //create the variable sciErr = createMatrixOfString(pvApiCtx, nbInputArgument(pvApiCtx) + 1, iRows, iCols, pstData); if(sciErr.iErr) { printError(&sciErr, 0); return 0; } //free container free(pstData); //assign allocated variables to Lhs position AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1; return 0; }
Scilab test script
Report an issue | ||
<< String reading (Scilab gateway) | Low level functions | polynomial >> |