有s型matlab,Matlab使用以下五种方式来实现S函数

Matlab使用以下五种方式来实现S函数

(2014-07-12 10:49:24)

标签:

it

matlab

simulink

s函数

A Level-1 M-file S-function provides a simple M interface to

interact with a small portion of the S-function API. Level-2 M-file

S-functions supersede Level-1 M-file S-functions.

Level 1

M文件S函数----这种方式提供了一个简单的M文件接口,可以与少部分的S函数API交互。Matlab对于这种方式的支持更多的是为了保持与以前版本的兼容,现在推荐采用的是Level

2 M文件S函数。

A Level-2 M-file S-function provides access to a more extensive set

of the S-function API and supports code generation. In most cases,

use a Level-2 M-file S-function when you want to implement your

S-function in M.

Level 2 M文件S函数----支持访问更多地S函数API,支持代码生成。当你要使用M文件来实现一个S函数的时候,选择Level

2 M文件S函数。

A handwritten C MEX S-function provides the most programming

flexibility. You can implement your algorithm as a C MEX S-function

or write a wrapper S-function to call existing C, C++, or Fortran

code. Writing a new S-function requires knowledge of the S-function

API and, if you want to generate inlined code for the S-function,

the Target Language Compiler (TLC).

手写C MEX S函数----这种方式提供了最大的编程自由度,你可以使用C MEX S函数来实现你的算法,也可以写一个wrapper

S函数,调用已经存在的C,C++,Fortran代码。使用这种方式编写一个新的S函数需要对于S函数API的了解,如果你写的S函数要产生内嵌式代码,还需要熟悉TLC。

The S-Function Builder is a graphical user interface for

programming a subset of S-function functionality. If you are new to

writing C MEX S-functions, you can use the S-Function Builder to

generate new S-functions or incorporate existing C or C++ code

without interacting with the S-function API. The S-Function Builder

can also generate TLC files for inlining your S-function during

code generation with the Real-Time Workshop product.

S函数创建器----这是采用图形用户界面的方式实现部分S函数功能的方式。如果你对于编写C MEX

S函数不熟悉,可以使用S函数创建器来产生新的S函数,或者将已有的C,C++代码集成到S函数中而不需要与S函数API打交道。S函数创建器可以同时生成TLC文件,这些TLC文件可以在自动代码生成时为你的S函数生成内嵌代码。

The Legacy Code Tool is a set of MATLAB commands that helps you

create an S-function to incorporate legacy C or C++ code. Like the

S-Function Builder, the Legacy Code Tool can generate a TLC file to

inline your S-function during code generation. The Legacy Code Tool

provides access to fewer of the methods in the S-function API than

the S-Function Builder or a handwritten C MEX S-function.

旧代码工具---是一系列的Matlab命令,这些命令帮助你集成以前的C,C++代码以生成一个S函数。与S函数创建器一样,旧代码工具可以产生TLC文件,不过相比于S函数创建器和手写的C

MEX S函数,旧代码工具只能访问很少的S函数API。

分享:

a4c26d1e5885305701be709a3d33442f.png喜欢

0

a4c26d1e5885305701be709a3d33442f.png赠金笔

加载中,请稍候......

评论加载中,请稍候...

发评论

登录名: 密码: 找回密码 注册记住登录状态

昵   称:

评论并转载此博文

a4c26d1e5885305701be709a3d33442f.png

发评论

以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值