ハンドルの行列を書き込む方法.
入力引数プロファイル:
SciErr createMatrixOfHandle(void* _pvCtx, int _iVar, int _iRows, int _iCols, const long long* _pllHandle)
Scilab環境ポインタ, api_scilab.h により定義された "pvApiCtx"で指定.
変数を保存するScilabメモリの位置.
返される変数の行数.
返される変数の列数.
返されるデータ配列のアドレス (大きさ: _iRows * _iCols).
エラー構造体で,エラーメッセージ履歴と最初のエラー番号を格納します.
入力引数プロファイル:
SciErr allocMatrixOfHandle(void* _pvCtx, int _iVar, int _iRows, int _iCols, long long** _pllHandle)
Scilab環境ポインタ, api_scilab.h により定義された "pvApiCtx"で指定.
変数を保存するScilabメモリの位置.
新規変数の行数.
新規変数の列数.
実数データ配列のアドレスを返す (大きさ: _iCols * _iRows).
エラー構造体で,エラーメッセージ履歴と最初のエラー番号を格納します.
このヘルプはハンドルの行列を書き込む方法を示します.
#include "api_scilab.h" int read_write_handle(char *fname,void* pvApiCtx) { SciErr sciErr; int i; //最初の変数の情報 : double実数行列 int iRows = 0; int iCols = 0; int *piAddr = NULL; long long* pllHandle = NULL; //入力/出力引数を確認 CheckInputArgument(pvApiCtx, 1,1); CheckOutputArgument(pvApiCtx, 0,1); //最初の入力引数の変数アドレスを取得 sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr); if(sciErr.iErr) { printError(&sciErr, 0); return 0; } // Scilabメモリから大きさとデータを取得 sciErr = getMatrixOfHandle(pvApiCtx, piAddr, &iRows, &iCols, &pllHandle); if(sciErr.iErr) { printError(&sciErr, 0); return 0; } sciErr = createMatrixOfHandle(pvApiCtx, nbInputArgument(pvApiCtx) + 1, iRows, iCols, pllHandle); if(sciErr.iErr) { printError(&sciErr, 0); return 0; } AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1; return 0; }
Version | Description |
5.5.0 | この関数は Scilab 5.5.0で追加されました |