Scilab 6.1.0
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.
getHypermatOfDouble
Get a hypermatrix of double variable.
Syntax
SciErr getHypermatOfDouble(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, double* _pdblReal)
Arguments
- _pvCtx
Scilab environment pointer, pass in "pvApiCtx" provided by api_scilab.h.
- _piAddress
Address of the Scilab variable.
- _dims
the hypermatrix dimensions.
- _ndims
the number of dimensions.
- _pdblReal
Double values.
Return value
A SciErr struct, the field iErr would contain the error number (0 if no error).
Gateway Source
#include "api_scilab.h" int hypermatExample(char *fname,void* pvApiCtx) { SciErr sciErr; int* piAddr = NULL; int iType = 0; int iRet = 0; CheckInputArgument(pvApiCtx, 1, 1); CheckOutputArgument(pvApiCtx, 0, 1); sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr); if (sciErr.iErr) { printError(&sciErr, 0); return 0; } if (isEmptyMatrix(pvApiCtx, piAddr)) { iRet = createEmptyMatrix(pvApiCtx, nbInputArgument(pvApiCtx) + 1); if (iRet) { return iRet; } AssignOutputVariable(pvApiCtx, 1) = 0; } else if (isHypermatType(pvApiCtx, piAddr)) { int * dims = NULL; int ndims; double* pdblReal = NULL; double* pdblImg = NULL; if (isHypermatComplex(pvApiCtx, piAddr)) { sciErr = getComplexHypermatOfDouble(pvApiCtx, piAddr, &dims, &ndims, &pdblReal, &pdblImg); if (sciErr.iErr) { printError(&sciErr, 0); return sciErr.iErr; } sciErr = createComplexHypermatOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1, dims, ndims, pdblReal, pdblImg); if (sciErr.iErr) { printError(&sciErr, 0); return sciErr.iErr; } } else { sciErr = getHypermatOfDouble(pvApiCtx, piAddr, &dims, &ndims, &pdblReal); if (sciErr.iErr) { printError(&sciErr, 0); return sciErr.iErr; } sciErr = createHypermatOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1, dims, ndims, pdblReal); if (sciErr.iErr) { printError(&sciErr, 0); return sciErr.iErr; } } AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1; } return 0; }
Scilab test script
Report an issue | ||
<< isHypermatType | hypermat | getHypermatOfInt >> |