получение ошибки MWMCR :: EvaluateFunction после развертывания функции matlab в сборке .net и использования ее в C # - PullRequest
0 голосов
/ 25 июня 2019

У меня есть функция Matlab, и я могу запустить ее из Matlab без каких-либо ошибок, но после ее развертывания в .Net Assembly и использования в C # я получаю следующую ошибку:

System.Exception
  HResult=0x80131500
  Message=

... MWMCR::EvaluateFunction error ... 
The logical indices contain a true value outside of the array bounds.
Error in => startx.m at line 42.

... Matlab M-code Stack Trace ...
    at
file startx.m, name startx, line 42.


  Source=MWArray
  StackTrace:
   at MathWorks.MATLAB.NET.Utility.MWMCR.EvaluateFunction(String functionName, Int32 numArgsOut, Int32 numArgsIn, MWArray[] argsIn)
   at MathWorks.MATLAB.NET.Utility.MWMCR.EvaluateFunction(String functionName, MWArray[] argsIn)
   at matlabTest.Form1.Button4_Click(Object sender, EventArgs e) in C:\Users\AhadOZU\source\repos\matlabTest\Form1.cs:line 71
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at matlabTest.Program.Main() in C:\Users\AhadOZU\source\repos\matlabTest\Program.cs:line 19
...