public void Close() { CheckPointer(); if (LibEng.engClose(m_engine) != 0) { throw new Exception("Unable to close this Engine, it may already have been closed"); } }
public void Eval(string cmd) { CheckPointer(); if (LibEng.engEvalString(m_engine, cmd) != 0) { throw new Exception("Unable to EvalString, it is possible that this engine doesn't exists anymore"); } }
public void SetVariable(string var_name, MxArray array) { if (array == null) { throw new ArgumentNullException("array"); } CheckPointer(); if (LibEng.engPutVariable(m_engine, var_name, array.NativeObject) != 0) { throw new Exception(String.Format("Unable to put variable {0} in Matlab Engine", var_name)); } }
public MxArray GetVariable(string var_name) { CheckPointer(); IntPtr var_ptr = LibEng.engGetVariable(m_engine, var_name); if (var_ptr == IntPtr.Zero) { return(null); } else { return(new MxArray(var_ptr)); } }
public static Engine OpenSingleUse() { return(new Engine(LibEng.engOpenSingleUse(), true)); }
public static Engine Open(bool closeOnDispose) { return(new Engine(LibEng.engOpen(), closeOnDispose)); }
public void OutputToBuffer(IntPtr buffer, int bufferSize) { CheckPointer(); LibEng.engOutputBuffer(m_engine, buffer, bufferSize); }