示例#1
0
 //=============================================================================
 /// <summary>
 /// Write a named matrix of boolean in Scilab
 /// </summary>
 /// <param name="matrixName"> variable name</param>
 /// <param name="iRows"> Number of row</param>
 /// <param name="iCols"> Number of column</param>
 /// <param name="matrixBoolean"> pointer on data</param>
 /// <returns> if the operation successes (0) or not ( !0 )</returns>
 //public int createNamedMatrixOfBoolean(string matrixName, int iRows, int iCols, Boolean[] matrixBoolean)
 //{
 //    int[] matrixInt = new int[matrixBoolean.Length];
 //    for (int i = 0; i < matrixBoolean.Length; i++)
 //    {
 //        if (matrixBoolean[i] == true)
 //        {
 //            matrixInt[i] = 1;
 //        }
 //        else
 //        {
 //            matrixInt[i] = 0;
 //        }
 //    }
 //    System.IntPtr ptrEmpty = new System.IntPtr();
 //    cEngineDlls.api_Err SciErr = cEngineDlls.createNamedMatrixOfBoolean(ptrEmpty, matrixName, iRows, iCols, matrixInt);
 //    return SciErr.iErr;
 //}
 //=============================================================================
 /// <summary>
 /// Write a named matrix of int(32) in Scilab
 /// </summary>
 /// <param name="matrixName"> variable name</param>
 /// <param name="iRows"> Number of row</param>
 /// <param name="iCols"> Number of column</param>
 /// <param name="matrixInt"> pointer on data</param>
 public int createNamedMatrixOfInt32(string matrixName, int iRows, int iCols, int[] matrixInt)
 {
     System.IntPtr ptrEmpty = new System.IntPtr();
     //cEngineDlls.api_Err SciErr = m_objScilabInvoker.createIntMat(ptrEmpty, matrixName, iRows, iCols, matrixInt);
     Scilab_cs_wrapper.api_Err SciErr = Scilab_cs_wrapper.createNamedMatrixOfInteger32(ptrEmpty, matrixName, iRows, iCols, matrixInt);
     return(SciErr.iErr);
 }