Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.0 - Русский

Change language to:
English - Français - 日本語 - Português -

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.

Справка Scilab >> API Scilab > Scilab Gateway API > LhsVar (deprecated)

LhsVar (deprecated)

a C gateway function which specifies which parameters created inside the C gateway will be returned as an output argument into Scilab. This function is obsolete.

Calling Sequence

LhsVar(RankPos) = RankVar;

Arguments

RankPos

as integer providing the rank of the output argument

RankVar

the rank of the parameter created inside the C gateway to be returned as an Scilab output argument

Description

A C gateway function which specifies which variables created inside the C interface will be returned as an output argument into Scilab.

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

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)

We create an intermediate Scilab parameter which will handle an integer but will neither be used nor returned as an output argument.

TODO: insert an example in the Scilab language

#include "stack-c.h"
#include "api_scilab.h"
int sci_mysizedouble(char * fname, unsigned long fname_len)
{
    int         m_in_row;
    int         n_in_col;
    int         *piAddr = NULL;
    double      *pdblData = NULL;
    SciErr      sciErr;

    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, 2, 1, 1, &m_in_row); // the out_lines_pos parameter handles the number of lines of the matrix sent as argument
    sciErr = createMatrixOfInteger32(pvApiCtx, 3, 1, 1, &m_in_row); // store a mere value, but will neither be used nor returned to Scilab
    sciErr = createMatrixOfInteger32(pvApiCtx, 4, 1, 1, &n_in_col); // store a mere value, but will neither be used nor returned to Scilab

    LhsVar(1) = 2; // We set the parameter 2 as an output argument
    LhsVar(2) = 4; // We set the parameter 4 as an output argument
    PutLhsVar();
    return 0;
}

See Also

  • AssignOutputVariable — a C gateway function which specifies which parameters created inside the C gateway will be returned as an output argument into Scilab.
Report an issue
<< Lhs (deprecated) Scilab Gateway API Rhs (deprecated) >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Fri Apr 11 14:19:50 CEST 2014