如何matlab函数“pchip”转换为C code。与MATLAB codeR [英] How to convert matlab function 'pchip' to c code with matlab coder
问题描述
我用Matlab codeR一个问题。我想生成从MATLAB C $ C $ç插值功能 pchip
。我验证与 coder.screener
的功能和它说,它适用于code一代,但是当我尝试建立 pchip.m
文件我得到这个错误:
I have a problem with Matlab Coder. I would like to generate C code from Matlab interpolating function pchip
. I verified the function with coder.screener
and it says it's available for code generation but when I try to build pchip.m
file I get this error:
函数'pchip'不支持独立code一代。见coder.extrinsic的文档以了解如何在模拟使用此功能。
The function 'pchip' is not supported for standalone code generation. See the documentation for coder.extrinsic to learn how you can use this function in simulation.
谁能帮我?我真的需要这个功能转换成下一个程序我写这封信。
Can anyone help me? I really need to convert this function in C for a program I am writing.
推荐答案
从code代 PP = pchip(X,Y)
的局限性的<一个href=\"http://www.mathworks.se/help/simulink/ug/functions-supported-for-$c$c-generation--alphabetical-list.html\"相对=nofollow>文档:
Limitations of pp = pchip(x,y)
for code generation from the documentation:
- 输入
X
必须严格递增。 - 不会删除
是
项。 - 如果您生成code为
PP = pchip(X,Y)
语法,你不能输入页
在MATLAB中的ppval
功能。从创建一个MATLAB
由code生成软件创建的结构:页
结构页
- Input
x
must be strictly increasing. - Does not remove
y
entries withNaN
values. - If you generate code for the
pp = pchip(x,y)
syntax, you cannot inputpp
to theppval
function in MATLAB. To create a MATLABpp
structure from app
structure created by the code generation software:- In code generation, use
unmkpp
to return the piecewise polynomial details to MATLAB. - In MATLAB, use
mkpp
to create thepp
structure.
所以,请检查您是否满足previous点;特别是最后一个。你如何使/毁了挣钱一picewise多项式文档中的例子。
So, please check that you fulfill the previous points; especially the last one. You have examples in the documentation of how to make/unmake a picewise polynomial.
这篇关于如何matlab函数“pchip”转换为C code。与MATLAB codeR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- In code generation, use
- Input
与
NaN的
值