Why does a class created through MATLAB Builder NE throw an exception at initialization?
显示 更早的评论
I'm trying to get a simple Builder NE example working with Visual Basic.NET 2010. I've defined a simple .m file which doesn't take any arguments and returns a simple array. It's pasted below:
function out = pass_nums()
out = {1;2;3}
I've built this .m file into a .dll using the Builder NE, set up for .NET V3.5 and have called the class "pass_nums_class"
My code in Visual Basic is this:
Imports System
Imports System.Reflection
Imports MathWorks.MATLAB.NET.Arrays
Imports MathWorks.MATLAB.NET.Utility
Imports pass_nums
Public Class Class1
Public Shared Sub main()
Dim Output_Array As MWArray = Nothing
Dim Matlink As pass_nums_class = New pass_nums_class
Output_Array = Matlink.pass_nums()
End Sub
End Class
I've set up references to the MWarray.dll and the pass_nums.dll. When I run the code it throws an error on the line where I'm defining the object, Matlink. It says "The type initializer for 'pass_nums.pass_nums_class' threw an exception."
Does anyone have an idea why this error is occuring and what I can do to correct it?
Thanks, -Mark
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Deploy to .NET Applications Using MWArray API 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!