Matlab错误“查找需要变量大小” [英] Matlab error "Find requires variable sizing"

查看:469
本文介绍了Matlab错误“查找需要变量大小”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< pre>< code>< x2& ocpRefPt(1,:)>< y1& ocpRefPt(1,:)

关于编译失败的行。上面的行是循环的。
x1 x2 x3 x4 是标量(自然数)
ocpRefPt 是一个2x16矩阵

 错误:FIND需要变量大小

这是什么意思。如何克服这个错误?

解决方案

所以你似乎正在尝试编译 emlmex

code>来制作嵌入式代码。错误是说 find 的输出大小是未知的,显然编译器需要固定大小的输出。请参阅此新闻组帖子一个解释。

这种编译方法似乎已经过时 - 使用 MATLAB coder codegen 命令):


emlmex 从MATLAB代码生成一个C-MEX文件。

  emlmex [-options] fun1 [fun2 ...] 

过时。对于通用加速
和代码生成,使用 CODEGEN


[~,col] = find(ocpRefPt(2,:)>x1 & ocpRefPt(2,:)<x2 & ocpRefPt(1,:)>y1 & ocpRefPt(1,:)<y2);

About is the line where the compilation fails. The above line is in a loop. x1,x2,x3,x4 are scalars(natural numbers) ocpRefPt is a 2x16 matrix

Error: FIND requires variable sizing

What does this mean. How to overcome this error?

解决方案

So it seems that you are trying to compile with emlmex to make embedded code. The error is saying that the size of the output of find is not known, and apparently the compiler requires fixed size outputs. See this newsgroup post for one explanation.

This method of compilation seems to be obsolete -- use the MATLAB coder (codegen command) instead:

emlmex Generate a C-MEX file from MATLAB code.

emlmex [-options] fun1 [fun2 ...]

This function is obsolete. For general purpose acceleration and code generation use CODEGEN.

这篇关于Matlab错误“查找需要变量大小”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆