[Matlab]Attempt to reference field of non-structure array
2012-05-09 21:45
344 查看
MATLAB是一个非常强悍的数学应用软件。其最大的亮点是能把自身的命令编译成JAVA、C#、C++等代码,把其应用嵌入到里面,使各类编程语言能够调用其功能。但在其编译过程经常出现各类问题,我在应用过程中把一些问题总结了一下,如下:
1.Attempt to reference field of non-structure array
这个问题最有可能是MATLAB中存在两个相同名字的方法,但是调用的参数不同。在编译过程中,MATLAB把其中的相同名字的一个方法给编译进去,但是在代码里面却调用了另外一个相同名字的方法,造成参数引用类型出错。这种错误最常见是当MATLAB有LIBSVM的时候,因为LIBSVM的SVMTRAIN跟MATLAB的SVMTRAIN名字是相同的,但参数输入是不同的,所以在编译的时候要注意,要么更改当前默认目录然后再编译,要么就把LIBSVM删掉。
2.像EVAL、LOAD这些命令应用时,返回的值记得不要用字符作变量,一定要声明变量作变量。也就是不要调用LOAD(FILENAME,'VAR'),要用VAR = LOAD(FILENAME)。这样子在MATLAB编译成DLL时才能在代码里生成引用变量的代码。
1.Attempt to reference field of non-structure array
这个问题最有可能是MATLAB中存在两个相同名字的方法,但是调用的参数不同。在编译过程中,MATLAB把其中的相同名字的一个方法给编译进去,但是在代码里面却调用了另外一个相同名字的方法,造成参数引用类型出错。这种错误最常见是当MATLAB有LIBSVM的时候,因为LIBSVM的SVMTRAIN跟MATLAB的SVMTRAIN名字是相同的,但参数输入是不同的,所以在编译的时候要注意,要么更改当前默认目录然后再编译,要么就把LIBSVM删掉。
2.像EVAL、LOAD这些命令应用时,返回的值记得不要用字符作变量,一定要声明变量作变量。也就是不要调用LOAD(FILENAME,'VAR'),要用VAR = LOAD(FILENAME)。这样子在MATLAB编译成DLL时才能在代码里生成引用变量的代码。
相关文章推荐
- matlab 2013a 出现Attempt to reference field of non-structure array
- attempt to reference field of non-structure array
- Error: initial value of reference to non const must be lvalue 原因以及解决方法
- Attempt to read from field 'int android.graphics.Rect.bottom' on a null object reference
- Attempt to read from field 'int android.view.View.mViewFlags' on a null object reference
- C++ Error : initial value of reference to non-const must be an lvalue
- Attempt to read from field 'int android.view.View.mViewFlags' on a null object reference
- /* Non-recursive solution to Towers of Hanoi */
- 三大框架整合异常之No Hibernate Session bound to thread, and configuration does not allow creation of non-tran
- ASP.NET MVC Html.TextBox 报 Object reference not set to an instance of an object 的解决方案
- WebAdaptor Object reference not set to an instance of an object.
- Object reference not set to an instance of an object
- Cannot make a static reference to the non-static method
- redeclared as different kind of symbol ,undefined reference to `__objc_class_name_Rectangle12'
- silverlight beta2.0安装成功后新建silverlight项目出现object reference not set to an instance of an object的解决办法
- Cannot make a static reference to the non-static method getLocalActivityManager()
- VB.NET Error Object reference not set to an instance of an object
- MATLAB Code of Artificial Potencial Field Method for Robot Path Planning
- No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
- smarty局部缓存,报错 Notice: Undefined index: data Notice: Trying to get property of non-object