public static void Quit() { if (__matlab != null) { __matlab.Quit(); __matlab = null; } }
} //static MLApp.MLApp _matlab { get { return GetMatlabInterface(); } } public static dynamic GetMatlabInterface() //public static MLApp.MLApp GetMatlabInterface() { int iter = 0; dynamic mlapp = (__matlab == null) ? null : __matlab.GetMatlabInterface(); //MLApp.MLApp mlapp = (__matlab == null) ? null : __matlab.GetMatlabInterface(); while (mlapp == null) { iter++; if (iter > 10) { return(null); } __matlab = new matlabimpl(); mlapp = __matlab.GetMatlabInterface(); } return(mlapp); }