如何matlab函数“pchip”转换为C code。与MATLAB codeR [英] How to convert matlab function 'pchip' to c code with matlab coder

查看:1410
本文介绍了如何matlab函数“pchip”转换为C code。与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 必须严格递增。

  • NaN的
  • 不会删除项。

  • 如果您生成code为 PP = pchip(X,Y)语法,你不能输入在MATLAB中的 ppval 功能。从创建一个MATLAB 结构页由code生成软件创建的结构:

    • 在code一代,使用 unmkpp 以分段多项式细节返回MATLAB。

    • 在MATLAB中,使用 mkpp 来创建结构。

    • Input x must be strictly increasing.
    • Does not remove y entries with NaN values.
    • If you generate code for the pp = pchip(x,y) syntax, you cannot input pp to the ppval function in MATLAB. To create a MATLAB pp structure from a pp 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 the pp 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屋!

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